GitHub
07/30/2024, 6:29 PM- name: add-run-no
config:
stream_maps:
customers:
run_id: config['run_id']
__alias__: customers_v8
stream_map_config:
run_id: ${RUN_ID} # export RUN_ID=$(printf '%(%Y-%m-%d-%H-%M-%S)T\n' -1);
I'd then run the above with export RUN_ID=$(printf '%(%Y-%m-%d-%H-%M-%S)T\n' -1); meltano run tap-csv add-run-no target-sqlite3.
The output here is:
@sbalnojan ➜ /workspaces/meltano-map-transform/examples (main) $ sqlite3 -markdown output/tap_csv.db 'select * from customers_v8 limit 20'
| email | env_run_id | first_name | id | ip_address | last_name | run_id | __loaded_at |
|----------------------------|------------|------------|----|-----------------|------------|-----------|----------------------------|
| ebook0@twitter.com | | Ethe | 1 | 67.61.243.220 | Book | ${RUN_ID} | 2023-03-27 11:56:41.716255 |
| mtire1@vkontakte.ru | | Myranda | 2 | 151.194.73.229 | Tire | ${RUN_ID} | 2023-03-27 11:56:41.716444 |
| rdorian2@twitpic.com | | Remus | 3 | 204.220.73.121 | Dorian | ${RUN_ID} | 2023-03-27 11:56:41.716584 |
I've tried one workaround:
- name: add-run-no
config:
stream_maps:
customers:
#768 run_id: config['run_id']
env_run_id: os.getenv('RUN_ID')
__alias__: customers_v8
stream_map_config:
run_id: ${RUN_ID} # export RUN_ID=$(printf '%(%Y-%m-%d-%H-%M-%S)T\n' -1);
. That code with the above run command gives me the (obv.) error:
singer_sdk.helpers._simpleeval.NameNotDefined: 'os' is not defined for expression 'os.getenv('RUN_ID')'
as the os package isn't accessible via simpleeval.
@aaronsteers @Edgar Ramírez (Arch.dev).
meltano/sdkGitHub
07/30/2024, 6:29 PM