oracle/dbt-oracle

[Bug] Wrong database name when connect to Autonomous Data Warehouse

onepas opened this issue · 4 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I found database param that is service name + database name, like that hclpszeflasrnfx_unnbpfflyfh4xboz, so dbt can't find old relation objects.

relation.py

@classmethod
    def create(
        cls: Type[Self],
        database: Optional[str] = None,
        schema: Optional[str] = None,
        identifier: Optional[str] = None,
        type: Optional[RelationType] = None,
        **kwargs,
    ) -> Self:
        kwargs.update(
            {
                "path": {
                    "database": database,
                    "schema": schema,
                    "identifier": identifier,
                },
                "type": type,
            }
        )
        return cls.from_dict(kwargs)

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output using --debug flag enabled

No response

Environment

- OS: MACOS
- Python: 3.9
- dbt: 1.5.0

What Oracle database version are you using dbt with?

19c

Additional Context

No response

@onepas What is the error ? Have you defined database in profiles.yml ? You can remove that database from profiles.yml

Error is:
First time, dbt run OK, models created in DB, and second time, dbt run with error, the error message: tables exists on DB (bug relate to check old relation objects in db)

Remove database field from profiles.yml and try again. database field is optional.

Remove database field from profiles.yml and try again. database field is optional.

Thanks, it's worked