forked from meltano/meltano
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Expand environment variables in array setting values (meltano#8268
) * fix: Expand enviroment variables in array setting values Closes meltano#3171 * Do not support `flat=True` for expanding env vars in lists * Test with flat array * Remove redundant test * Update src/meltano/core/utils/__init__.py Co-authored-by: @WillDaSilva --------- Co-authored-by: Will Da Silva <[email protected]>
- Loading branch information
1 parent
4fa64ab
commit f2358d3
Showing
12 changed files
with
184 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
integration/example-library/meltano-expand-envvars-in-array/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/venv | ||
/.meltano | ||
.env |
1 change: 1 addition & 0 deletions
1
integration/example-library/meltano-expand-envvars-in-array/data/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!*.jsonl |
10 changes: 10 additions & 0 deletions
10
integration/example-library/meltano-expand-envvars-in-array/data/birds.jsonl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"id": 1, "description": "Bald Eagle", "verified": true, "views": 89, "created_at": "2022-03-15T09:45:30Z"} | ||
{"id": 2, "description": "American Robin", "verified": true, "views": 72, "created_at": "2022-05-18T14:20:12Z"} | ||
{"id": 3, "description": "Peregrine Falcon", "verified": true, "views": 65, "created_at": "2022-07-10T17:55:42Z"} | ||
{"id": 4, "description": "Northern Cardinal", "verified": true, "views": 51, "created_at": "2022-09-04T21:12:58Z"} | ||
{"id": 5, "description": "Mallard Duck", "verified": true, "views": 47, "created_at": "2022-11-09T11:30:25Z"} | ||
{"id": 6, "description": "European Swallow", "verified": true, "views": 39, "created_at": "2023-01-22T08:15:37Z"} | ||
{"id": 7, "description": "Ruby-throated Hummingbird", "verified": true, "views": 54, "created_at": "2023-03-05T14:48:19Z"} | ||
{"id": 8, "description": "Great Horned Owl", "verified": true, "views": 68, "created_at": "2023-05-14T20:05:52Z"} | ||
{"id": 9, "description": "European Starling", "verified": true, "views": 42, "created_at": "2023-07-19T09:10:36Z"} | ||
{"id": 10, "description": "Blue Jay", "verified": true, "views": 59, "created_at": "2023-09-30T16:27:04Z"} |
10 changes: 10 additions & 0 deletions
10
integration/example-library/meltano-expand-envvars-in-array/data/mammals.jsonl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"id": 1, "description": "African Elephant", "verified": true, "views": 125, "created_at": "2022-03-15T09:45:30Z"} | ||
{"id": 2, "description": "Bengal Tiger", "verified": true, "views": 98, "created_at": "2022-05-18T14:20:12Z"} | ||
{"id": 3, "description": "Koala", "verified": true, "views": 73, "created_at": "2022-07-10T17:55:42Z"} | ||
{"id": 4, "description": "Gray Wolf", "verified": true, "views": 55, "created_at": "2022-09-04T21:12:58Z"} | ||
{"id": 5, "description": "Giraffe", "verified": true, "views": 62, "created_at": "2022-11-09T11:30:25Z"} | ||
{"id": 6, "description": "Panda Bear", "verified": true, "views": 48, "created_at": "2023-01-22T08:15:37Z"} | ||
{"id": 7, "description": "Dolphin", "verified": true, "views": 77, "created_at": "2023-03-05T14:48:19Z"} | ||
{"id": 8, "description": "Red Fox", "verified": true, "views": 36, "created_at": "2023-05-14T20:05:52Z"} | ||
{"id": 9, "description": "Orangutan", "verified": true, "views": 43, "created_at": "2023-07-19T09:10:36Z"} | ||
{"id": 10, "description": "Grizzly Bear", "verified": true, "views": 50, "created_at": "2023-09-30T16:27:04Z"} |
10 changes: 10 additions & 0 deletions
10
integration/example-library/meltano-expand-envvars-in-array/data/reptiles.jsonl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"id": 1, "description": "Komodo Dragon", "verified": true, "views": 74, "created_at": "2022-03-15T09:45:30Z"} | ||
{"id": 2, "description": "Green Sea Turtle", "verified": true, "views": 63, "created_at": "2022-05-18T14:20:12Z"} | ||
{"id": 3, "description": "King Cobra", "verified": true, "views": 58, "created_at": "2022-07-10T17:55:42Z"} | ||
{"id": 4, "description": "Gila Monster", "verified": true, "views": 42, "created_at": "2022-09-04T21:12:58Z"} | ||
{"id": 5, "description": "Galapagos Tortoise", "verified": true, "views": 53, "created_at": "2022-11-09T11:30:25Z"} | ||
{"id": 6, "description": "American Alligator", "verified": true, "views": 67, "created_at": "2023-01-22T08:15:37Z"} | ||
{"id": 7, "description": "Western Diamondback Rattlesnake", "verified": true, "views": 49, "created_at": "2023-03-05T14:48:19Z"} | ||
{"id": 8, "description": "Chameleon", "verified": true, "views": 38, "created_at": "2023-05-14T20:05:52Z"} | ||
{"id": 9, "description": "Iguana", "verified": true, "views": 45, "created_at": "2023-07-19T09:10:36Z"} | ||
{"id": 10, "description": "Leopard Gecko", "verified": true, "views": 55, "created_at": "2023-09-30T16:27:04Z"} |
27 changes: 27 additions & 0 deletions
27
integration/example-library/meltano-expand-envvars-in-array/ending-meltano.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: 1 | ||
default_environment: dev | ||
project_id: 95ed0825-997f-4baf-9c13-bae04ac44fe1 | ||
environments: | ||
- name: dev | ||
- name: staging | ||
- name: prod | ||
send_anonymous_usage_stats: false | ||
plugins: | ||
extractors: | ||
- name: tap-smoke-test | ||
namespace: tap_smoke_test | ||
pip_url: git+https://github.com/meltano/tap-smoke-test.git | ||
executable: tap-smoke-test | ||
capabilities: | ||
- discover | ||
- catalog | ||
settings: | ||
- name: schema_inference_record_count | ||
kind: integer | ||
- name: streams | ||
kind: array | ||
config: | ||
schema_inference_record_count: 5 | ||
streams: | ||
- stream_name: $ANIMAL_GROUP | ||
input_filename: $MELTANO_PROJECT_ROOT/data/$ANIMAL_GROUP.jsonl |
19 changes: 19 additions & 0 deletions
19
integration/example-library/meltano-expand-envvars-in-array/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Expanding environment variables in elements of an array setting value | ||
|
||
This is a simple example of how to expand environment variables in elements of an array setting value. | ||
|
||
## Setup | ||
|
||
Install the project dependencies: | ||
|
||
```shell | ||
meltano install | ||
``` | ||
|
||
## Run the pipeline | ||
|
||
```shell | ||
ANIMAL_GROUP=birds meltano invoke tap-smoke-test | ||
ANIMAL_GROUP=reptiles meltano invoke tap-smoke-test | ||
ANIMAL_GROUP=mammals meltano invoke tap-smoke-test | ||
``` |
27 changes: 27 additions & 0 deletions
27
integration/example-library/meltano-expand-envvars-in-array/meltano.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: 1 | ||
default_environment: dev | ||
project_id: 95ed0825-997f-4baf-9c13-bae04ac44fe1 | ||
environments: | ||
- name: dev | ||
- name: staging | ||
- name: prod | ||
send_anonymous_usage_stats: false | ||
plugins: | ||
extractors: | ||
- name: tap-smoke-test | ||
namespace: tap_smoke_test | ||
pip_url: git+https://github.com/meltano/tap-smoke-test.git | ||
executable: tap-smoke-test | ||
capabilities: | ||
- discover | ||
- catalog | ||
settings: | ||
- name: schema_inference_record_count | ||
kind: integer | ||
- name: streams | ||
kind: array | ||
config: | ||
schema_inference_record_count: 5 | ||
streams: | ||
- stream_name: $ANIMAL_GROUP | ||
input_filename: $MELTANO_PROJECT_ROOT/data/$ANIMAL_GROUP.jsonl |
2 changes: 2 additions & 0 deletions
2
integration/example-library/meltano-expand-envvars-in-array/output/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters