Kyle Niosco
06/04/2024, 3:47 PMKyle Niosco
06/04/2024, 3:48 PMCould not parse SQLAlchemy URL from string...Yolan Honoré-Rougé
06/04/2024, 5:27 PMKyle Niosco
06/05/2024, 4:34 AMcredentials.yml
postgres_db:
con: ${oc.env:POSTGRES_DB_URI}
catalog.yml
spot_prices_ohlc:
type: CachedDataset
dataset:
type: pandas.SQLQueryDataset
sql: [SQL Query here]
credentials:
con: postgres_db
And then I also set up the OmegaConfigLoader at settings.py
from kedro.config import OmegaConfigLoader
CONFIG_LOADER_CLASS = OmegaConfigLoader
Can you check if I missed something or if I did a mistake on these modifications? Thanks a lot.Yolan Honoré-Rougé
06/05/2024, 5:48 AMcredentials.yml
# empty
catalog.yml
spot_prices_ohlc:
type: CachedDataset
dataset:
type: pandas.SQLQueryDataset
sql: [SQL Query here]
credentials:
con: ${oc.env: POSTGRES_DB_URI}
(Btw, What version of kedro are you using? You don't need to declare OmegaConfigLoader in settings.py if you use kedro>=0.19)Kyle Niosco
06/05/2024, 5:50 AMKyle Niosco
06/05/2024, 6:17 AMUnsupportedInterpolationType: Unsupported interpolation type oc.env full_key: spot_prices_ohlc.dataset.credentials.con object_type=dict
2. Without OmegaConfigLoader setup (previous error):
Could not parse SQLAlchemy URL from string '${oc.env:POSTGRES_DB_URI}'Ankita Katiyar
06/05/2024, 6:52 AMsettings.py -
from omegaconf.resolvers import oc
CONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
"custom_resolvers": {
"oc.env": oc.env,
}
}Ankita Katiyar
06/05/2024, 6:54 AMoc.env resolver is not enabled by default but it can be turned on by passing it as a custom resolverKyle Niosco
06/05/2024, 6:54 AMTypeError: ConfigLoader.__init__() got an unexpected keyword argument 'custom_resolvers'Ankita Katiyar
06/05/2024, 6:59 AMsettings.py -
from kedro.config import OmegaConfigLoader
CONFIG_LOADER_CLASS = OmegaConfigLoader
From 0.19.x OmegaConfigLoader is the default config loader but it has to be set explicitly in the 0.18.x seriesKyle Niosco
06/05/2024, 7:05 AMUnsupportedValueType: Value 'date' is not a supported primitive type full_key: start_date object_type=dictAnkita Katiyar
06/05/2024, 7:09 AMKyle Niosco
06/05/2024, 8:05 AMAnkita Katiyar
06/05/2024, 8:53 AMomegaconf, the underlying library for OmegaConfigLoader doesn’t support non primitive data types like date 🤔
Would it be possible to get these values from streamlit as strings? and then convert them to date format using a custom resolverKyle Niosco
06/05/2024, 9:14 AMKyle Niosco
06/06/2024, 6:36 AMdatajoely
06/06/2024, 8:17 AMKyle Niosco
06/06/2024, 12:07 PM