-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lookupatts cannot be NoneType even if defaultid is set #71
Comments
The error persist even with the lookupatt being set to rows = [
{"country_name": "Australia", "alpha2": "AU", "alpha3": "AUS"},
{"country_name": "Brazil", "alpha2": "BR", "alpha3": "BRA"},
{"country_name": "Canada", "alpha2": "CA", "alpha3": "CAN"},
{"country_name": "Denmark", "alpha2": "DK", "alpha3": "DNK"},
{"country_name": "unknown", "alpha2": None, "alpha3": None},
] Only by removing the dim = CachedDimension(
name="dim.country_dim",
key="country_id",
attributes=[
"country_name",
"alpha2",
"alpha3"
],
lookupatts=["country_name"],
targetconnection=cw
) Am I using the |
Hi,
In the second example, To solve your current problem, I guess you could make your code only call And if dim.country_dim is preloaded, you can use Best regards, |
@chrthomsen thanks for the quick response. My current "workaround" is simply to substitute None values in lookupatt ( To sum it up, it seems that the ´defaultidvalue´ changes the insert behavior of the ensure method which I did not expect. This may be intended behavior, but surprising to me non the less : ) It's not at all a dealbreaker, just something i found interesting. |
Setting the
defaultidvalue
does not prevent insert when lookupatt is NonePostgreSQL throws the following error:
Expected behaviour:
defaultidvalue is used when lookupatt(s) is None.
The text was updated successfully, but these errors were encountered: