Skip to content
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

[Bug] null values should be of type null and not of type string in manifest.json #74

Open
1 task done
geoHeil opened this issue Feb 22, 2023 · 4 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@geoHeil
Copy link

geoHeil commented Feb 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Null values are rendered as proprietary "None" string fields in manifest.json.

https://getdbt.slack.com/archives/C01PWH4TXLY/p1677050123391359

Expected Behavior

Null values are rendered as valid JSON nulls in manifest.json

Steps To Reproduce

dbt run

for version 1.3.2 of dbt-oracle

Relevant log output using --debug flag enabled

No response

Environment

- OS: linux
- Python: 3.10
- dbt: 1.3.2

What Oracle database version are you using dbt with?

11

Additional Context

No response

@geoHeil geoHeil added the bug Something isn't working label Feb 22, 2023
@geoHeil
Copy link
Author

geoHeil commented Feb 22, 2023

This issue persists in the 1.4 RC release

@aosingh
Copy link
Member

aosingh commented Feb 24, 2023

@geoHeil

Python None type translates to null in JSON

The issue you reported is only the case with database field because of how database is declared. We could not declare the default value to None as you can see below.

    # Specifying database is optional
    database: Optional[str]

    # OracleConnectionMethod.TNS
    tns_name: Optional[str] = None

The reason is some validation enforced by dbt. if you change database's default value to None, dbt command fails.

  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py", line 504, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'schema' follows default argument

If default value could be declared None, manifest.json will have a valid null

@geoHeil
Copy link
Author

geoHeil commented Feb 25, 2023

Ok - let me rais an issue then in dbt-core.

@jtcohen6
Copy link

I left a comment on the dbt-core issue: dbt-labs/dbt-core#7051 (comment)

I haven't been able to look into it extensively, but following the precedent in dbt-spark, dbt-synapse, and others, I believe it should be possible for dbt-oracle to use a real Python None representation for database, rather than the string value "None".

@aosingh aosingh assigned aosingh and rkope99 and unassigned aosingh Jun 13, 2023
@aosingh aosingh assigned amoghparab1805 and unassigned rkope99 Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants