Skip to content

Fix the BigQuery namespace-exists error message - #4415

Open
farisbasha wants to merge 1 commit into
apache:mainfrom
farisbasha:fix-bigquery-namespace-exists-message
Open

farisbasha wants to merge 1 commit into
apache:mainfrom
farisbasha:fix-bigquery-namespace-exists-message

Conversation

@farisbasha

Copy link
Copy Markdown

Rationale for this change

In the BigQuery catalog, the "namespace already exists" error shows "{database_name}" literally. The string is missing the f prefix. Now it shows the real namespace name.

Are these changes tested?

I added a test with a mocked client that raises Conflict.

Are there any user-facing changes?

The error message now shows the real namespace name.

AI disclosure: an AI assistant (Claude) found the bug and wrote the fix and the test. The diff was reviewed by the assistant on my behalf; I have not run the change myself.

The message was a plain string, so it showed the literal
"{database_name}" instead of the namespace name. Make it an f-string
and add a test for create_namespace on an existing dataset.

@ebyhr ebyhr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I confirmed the new test fails without the fix and passes with it. I also checked the rest of pyiceberg/ for the same mistake and found no other instances.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants