Skip to content

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

Closed
@acrede

Description

@acrede

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
[...]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions