Skip to content

fix: database None error in spark.sql('use #660

Merged
yotahk merged 3 commits intoaws-samples:mainfrom
akmalsoliev:main
Mar 12, 2026
Merged

fix: database None error in spark.sql('use #660
yotahk merged 3 commits intoaws-samples:mainfrom
akmalsoliev:main

Conversation

@akmalsoliev
Copy link
Copy Markdown
Contributor

@akmalsoliev akmalsoliev commented Feb 12, 2026

Description

When database is not present in profiles.yml the code doesn't default to schema, adding condition that would use both.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-glue next" section.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment thread dbt/adapters/glue/gluedbapi/connection.py Outdated
@yotahk
Copy link
Copy Markdown
Collaborator

yotahk commented Mar 5, 2026

Thanks for the contribution, please update CHANGELOG.md. It might conflict with your other PRs but it can be resolved easily.

@akmalsoliev
Copy link
Copy Markdown
Contributor Author

Hey @yotahk,
As pre your last comment on self.credentials.database being set to None, I have completely removed the condition and made spark.sql("use schema rather than database. Also added a check condition that would raise an error if self.credentials.schema is not present. This shouldn't occur, however, would be helpful in future.

@akmalsoliev
Copy link
Copy Markdown
Contributor Author

Hey @yotahk I believe that this PR is ready for a merge.

Comment thread dbt/adapters/glue/gluedbapi/connection.py Outdated
@yotahk yotahk added enable-functional-tests This label enable functional tests and removed enable-functional-tests This label enable functional tests labels Mar 12, 2026
Copy link
Copy Markdown
Collaborator

@yotahk yotahk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yotahk yotahk merged commit fb4fb1c into aws-samples:main Mar 12, 2026
26 checks passed
@yotahk
Copy link
Copy Markdown
Collaborator

yotahk commented Mar 12, 2026

Merged. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor enable-functional-tests This label enable functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants