Skip to content

[Bug] Null values in column_id causes error in documentation generation #86

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

Closed
1 task done
acrede opened this issue May 31, 2023 · 5 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@acrede
Copy link

acrede commented May 31, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running dbt docs generate an error is caused when there are Null values in sys.all_tab_columns.column_id.

Error:

[...]
  File "...\lib\site-packages\dbt\task\generate.py", line 100, in add_column
    column_data["index"] = int(column_data["index"])
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

The column has no not null constraint and can be null sometimes.

Expected Behavior

The documentation should be created even if null values are present.

Steps To Reproduce

No response

Relevant log output using --debug flag enabled

No response

Environment

- OS: Ubuntu 22.04
- Python: 3.10
- dbt: 1.5

What Oracle database version are you using dbt with?

19c

Additional Context

This issue could be solved easily by changing the sql in /include/oracle/macros/catalog.sql:

with columns as (
    [...]
	// column_id ordinal_position,				# old
        coalesce(column_id, 0) ordinal_position,		# new
[...]
@acrede acrede added the bug Something isn't working label May 31, 2023
@aosingh aosingh self-assigned this Jun 1, 2023
@aosingh
Copy link
Member

aosingh commented Jun 1, 2023

Thanks @acrede for reporting this issue. I am checking this.

@aosingh aosingh assigned rkope99 and unassigned aosingh Jun 13, 2023
@Gabriel-L-Silva
Copy link

Is this fixed?

@aosingh
Copy link
Member

aosingh commented Aug 29, 2023

@Gabriel-L-Silva Sorry for the delay here. We somehow could not reproduce this problem. Are you testing against on-prem Database or Autonomous Database?

There are a couple of cases which I want to clarify:

  • what if column_id is null for multiple relations or
  • what if multiple column_ids are null in the same relation
    In both the cases, column_id will be 0. I just want to make sure the documentation doesn't break in such cases

@aosingh aosingh mentioned this issue Sep 14, 2023
@aosingh
Copy link
Member

aosingh commented Sep 15, 2023

@Gabriel-L-Silva @acrede
This is fixed in dbt-oracle==1.6.0

@Gabriel-L-Silva
Copy link

thank you!!

aosingh added a commit that referenced this issue Sep 26, 2023
- #100
- #86
- #99
- Set connection id prefix to track dbt connections in cman logs
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

4 participants