jan_kyri
04/25/2022, 4:02 PMenv
vars into a tap config in meltano.yml
?
I was quite surprised to learn about Meltano’s configuration
system which seems to effectively limit the places environment variables can be used. I would need to set a value that is not accessible via the tap-rest-api-msdk
.
Has anyone solved this with an intermediate script?visch
04/25/2022, 4:05 PMjan_kyri
04/25/2022, 4:05 PMjan_kyri
04/25/2022, 4:05 PMvisch
04/25/2022, 4:06 PMjan_kyri
04/25/2022, 4:06 PMmeltano config tap-rest-api-msdk list
outputs
Custom, possibly unsupported by the plugin:
streams [env: TAP_REST_API_MSDK_STREAMS] current value: [{'name': 'current_weather', 'path': '/onecall', 'params': {'lat': 52, 'lon': 13, 'cnt': 7, 'appid': '$OPENWEATHER_KEY', 'exclude': 'hourly,current,minutely,alerts'}, 'primary_keys': ['dt']}] (from `meltano.yml`)
visch
04/25/2022, 4:06 PMjan_kyri
04/25/2022, 4:06 PMjan_kyri
04/25/2022, 4:06 PMjan_kyri
04/25/2022, 4:07 PMvisch
04/25/2022, 4:07 PMvisch
04/25/2022, 4:07 PM'appid': '$OPENWEATHER_KEY'
Should be what?visch
04/25/2022, 4:07 PMjan_kyri
04/25/2022, 4:07 PM.env
file.jan_kyri
04/25/2022, 4:07 PMvisch
04/25/2022, 4:09 PMexport TAP_REST_API_MDK_APPID='abcdefg'
jan_kyri
04/25/2022, 4:12 PMTAP_REST_API_MDK_APPID
.
Still not being applied in the stream.
- name: tap-rest-api-msdk
pip_url: tap-rest-api-msdk
executable: tap-rest-api-msdk
namespace: tap_rest_api_msdk
capabilities:
- state
- catalog
- discover
settings:
- name: appid
config:
api_url: <https://api.openweathermap.org/data/2.5>
streams:
- name: current_weather
path: /onecall
params:
lat: 52
lon: 13
cnt: 7
appid: $TAP_REST_API_MSDK_APPID
exclude: hourly,current,minutely,alerts
primary_keys:
- dt
jan_kyri
04/25/2022, 4:12 PMjan_kyri
04/25/2022, 4:12 PMvisch
04/25/2022, 4:12 PMsettings:
- name: appid
config:
api_url: <https://api.openweathermap.org/data/2.5>
streams:
- name: current_weather
path: /onecall
params:
lat: 52
lon: 13
cnt: 7
appid: $TAP_REST_API_MSDK_APPID
exclude: hourly,current,minutely,alerts
primary_keys:
- dt
What is this from? doesn't look like valid meltano.yml
to mejan_kyri
04/25/2022, 4:13 PMmeltano.yml
and the indentation got mixed up on copying over here.jan_kyri
04/25/2022, 4:13 PMvisch
04/25/2022, 4:13 PMjan_kyri
04/25/2022, 4:15 PMvisch
04/25/2022, 4:16 PMmeltano.yml
?jan_kyri
04/25/2022, 4:17 PMversion: 1
default_environment: dev
project_id: foobar
plugins:
extractors:
- name: tap-rest-api-msdk
pip_url: tap-rest-api-msdk
executable: tap-rest-api-msdk
namespace: tap_rest_api_msdk
capabilities:
- state
- catalog
- discover
settings:
- name: api_url
- name: auth_method
- name: auth_token
- name: name
- name: path
- name: params
- name: headers
- name: records_path
- name: primary_keys
- name: replication_key
- name: except_keys
- name: num_inference_records
- name: appid
config:
api_url: <https://api.openweathermap.org/data/2.5>
streams:
- name: current_weather
path: /onecall
params:
lat: 52
lon: 13
cnt: 7
appid: $TAP_REST_API_MSDK_APPID
exclude: hourly,current,minutely,alerts
primary_keys:
- dt
loaders:
- name: target-csv
variant: hotgluexyz
pip_url: git+<https://github.com/hotgluexyz/target-csv.git@0.3.3>
- name: target-postgres
variant: transferwise
pip_url: git+<https://github.com/transferwise/pipelinewise-target-postgres.git>
config:
host: $TARGET_POSTGRES_HOST
port: $TARGET_POSTGRES_PORT
user: $TARGET_POSTGRES_USER
password: $TARGET_POSTGRES_PASSWORD
dbname: $TARGET_POSTGRES_DBNAME
default_target_schema: $TARGET_POSTGRES_SCHEMA
environments:
- name: dev
- name: staging
- name: prod
visch
04/25/2022, 4:18 PMvisch
04/25/2022, 4:24 PMstreams
config.
One option (although not great) although it'd answer your original question would be
meltano config tap-clickup set streams "{"params":["appid":"abcdefg"]" --store dotenv
(Or set the same variable directly as an environment variable instead which also works)visch
04/25/2022, 4:26 PMvisch
04/25/2022, 4:27 PMjan_kyri
04/25/2022, 4:48 PMvisch
04/25/2022, 5:01 PMrick_lamers
05/10/2022, 1:09 PMDid you accidentally use a different tap name here?meltano config tap-clickup set streams "{"params":["appid":"abcdefg"]" --store dotenv
visch
05/10/2022, 1:10 PMtap-rest-api-msdk
in this case