Skip to content

feat(ibis): remove to_char from BigQuery white function list#1275

Merged
goldmedal merged 1 commit intoCanner:mainfrom
douenergy:update-bigquery-function-list
Jul 30, 2025
Merged

feat(ibis): remove to_char from BigQuery white function list#1275
goldmedal merged 1 commit intoCanner:mainfrom
douenergy:update-bigquery-function-list

Conversation

@douenergy
Copy link
Copy Markdown
Contributor

@douenergy douenergy commented Jul 30, 2025

following #1271
related to tobymao/sqlglot#5496

When performing fuzz testing, the test case for to_char is

SELECT to_char(current_date(), 'YYYY-MM-DD') AS result

and sqlglot is smart enough to rewrite it to:

SELECT CAST(CURRENT_DATE AS STRING) AS `result`

However, when combining to_char with the cast function, the rewrite does not work:

SELECT TO_CHAR(
    CAST(contacts.createdAt AS TIMESTAMP WITH TIME ZONE), 
    'YYYY-MM'
) AS year_month,
COUNT(*) AS contact_count
FROM contacts
WHERE CAST(contacts.createdAt AS TIMESTAMP WITH TIME ZONE) >= CAST('2023-01-01 00:00:00' AS TIMESTAMP WITH TIME ZONE)
  AND CAST(contacts.createdAt AS TIMESTAMP WITH TIME ZONE) < CAST('2025-01-01 00:00:00' AS TIMESTAMP WITH TIME ZONE)
GROUP BY year_month
ORDER BY year_month ASC

This results in the error:

Argument 'format' is not supported for expression 'ToChar' when targeting Dialect.

Summary by CodeRabbit

  • Tests
    • Updated a test to expect a different number of functions returned from the /functions endpoint.

@github-actions github-actions bot added bigquery ibis python Pull requests that update Python code labels Jul 30, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

A test in the BigQuery connector's function list endpoint was updated to expect 173 functions instead of 174 when remote function list paths are set. No other test logic or assertions were changed.

Changes

Cohort / File(s) Change Summary
BigQuery Function List Test Update
ibis-server/tests/routers/v3/connector/bigquery/test_functions.py
Adjusted the expected function count in test_function_list from 174 to 173 when remote function list paths are configured.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

bigquery, ibis, python

Poem

A function count, now one less than before,
BigQuery's list trimmed, but tests still soar.
Rabbits count carrots, and functions too—
173 is just right, not askew.
🥕✨
Hop along, code, your tests are true!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d9bbd2 and 377332e.

⛔ Files ignored due to path filters (1)
  • ibis-server/resources/white_function_list/bigquery.csv is excluded by !**/*.csv
📒 Files selected for processing (1)
  • ibis-server/tests/routers/v3/connector/bigquery/test_functions.py (1 hunks)
🔇 Additional comments (1)
ibis-server/tests/routers/v3/connector/bigquery/test_functions.py (1)

54-54: Verified: BigQuery white function list count matches updated test
The CSV at ibis-server/resources/white_function_list/bigquery.csv has 174 total lines (1 header + 173 entries), so assert len(result) == 173 is correct.
No further changes needed.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@douenergy
Copy link
Copy Markdown
Contributor Author

I have run all bigquery test on my local
bigquery

@douenergy douenergy self-assigned this Jul 30, 2025
@douenergy douenergy requested a review from goldmedal July 30, 2025 02:02
Copy link
Copy Markdown
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thanks @douenergy 👍

@goldmedal goldmedal changed the title feat(ibis): update bigquery white function list feat(ibis): remove to_char from BigQuery white function list Jul 30, 2025
@goldmedal goldmedal merged commit ac98c5d into Canner:main Jul 30, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigquery ibis python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants