Hey all. Looking for some help with using stream m...
# troubleshooting
t
Hey all. Looking for some help with using stream maps with environment variables within the context of inherited plugins. Here are the docs I'm referencing for "declaring" the property I'd like to set a stream map up for in my meltano.yml config, so that I can then use an environment variable later on. The actual transformation I'm doing is very simple, it's just
str(fieldname)
. Here is my
settings
block in my config:
Copy code
settings:
    - name: stream_maps.public-organization_connected_apps.metadata
metadata
happens to be the name of the column I'm trying to use in my stream map. Down stream, I set this up like so (executing from an Airflow environment):
Copy code
env_vars["TAP_POSTGRES__POS_STREAM_MAPS_PUBLIC_ORGANIZATION_CONNECTED_APPS_METADATA"] = "str(metadata)"
And all of that works perfectly. But then I realized that the
settings
block is in my top level
tap-postgres
plugin config. This may cause an issue because I use several extractors that inherit from this top level config so that I can pull from multiple source databases. I'd like for the
settings
block to be pulled down into the inheriting extractor to avoid any column/property naming collisions. When I pull the
settings
block into the inheriting extractor, my tasks fail. The traceback is deep, but I can provide it. Ultimately, the error message is:
Copy code
KeyError: 'stream_maps.public-organization_connected_apps.metadata'
Is this a bug? Am I doing something wrong? Thank you! --- β€’ meltanolabs variant of
tap-postgres
v0.1.1 β€’ meltanolabs variant of
target-snowflake
v0.15.1 β€’ meltano version 3.6.0
e
Hi @taylor_van_anne!
I'd like for the
settings
block to be pulled down into the inheriting extractor to avoid any column/property naming collisions.
If you do this and then run
meltano config <inheriting extractor> list
, do you see expected env var for the setting?
πŸ‘€ 1
t
Hey @Edgar RamΓ­rez (Arch.dev)! I don't. I just see the name of my stream map printed out in red. And if I do this with debug log level, then I see the same traceback as my failed task.
I suspect it's not plugin-specific but rather something in meltano core. Here's the end of the traceback:
Copy code
β”‚ /project/.meltano_venv/lib/python3.9/site-packages/meltano/core/settings_sto β”‚
β”‚ re.py:1172 in get_with_metadata                                              β”‚
β”‚                                                                              β”‚
β”‚   1169 β”‚   β”‚   β”‚   A tuple containing the got value and accompanying metadat β”‚
β”‚   1170 β”‚   β”‚   """                                                           β”‚
β”‚   1171 β”‚   β”‚   if self.bulk:                                                 β”‚
β”‚ ❱ 1172 β”‚   β”‚   β”‚   metadata = self.config_with_metadata[name]                β”‚
β”‚   1173 β”‚   β”‚   β”‚   return metadata["value"], metadata                        β”‚
β”‚   1174 β”‚   β”‚                                                                 β”‚
β”‚   1175 β”‚   β”‚   return self.inherited_settings_service.get_with_metadata(name β”‚
╰──────────────────────────────────────────────────────────────────────────────╯
KeyError: 'stream_maps.public-organization_connected_apps.metadata'
πŸ‘€ 1