Skip to content

add user agent to bigquery connector#3232

Merged
samhita-alla merged 4 commits into
masterfrom
bigquery-useragent
Apr 23, 2025
Merged

add user agent to bigquery connector#3232
samhita-alla merged 4 commits into
masterfrom
bigquery-useragent

Conversation

@samhita-alla
Copy link
Copy Markdown
Contributor

@samhita-alla samhita-alla commented Apr 17, 2025

Tracking issue

Why are the changes needed?

necessary for the bigquery partnership with google.

What changes were proposed in this pull request?

added user agent to the bigquery client call per the format described by google.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

This PR enhances the BigQuery integration by adding a custom user agent to meet Google partnership requirements. It reorganizes imports, adjusts client initialization with safer domain field handling using .get() method, and updates task configuration to include domain details. These changes improve error handling, ensure compliance, and validate the updated client configuration.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
@flyte-bot
Copy link
Copy Markdown
Contributor

flyte-bot commented Apr 17, 2025

Code Review Agent Run #95d281

Actionable Suggestions - 1
  • plugins/flytekit-bigquery/flytekitplugins/bigquery/task.py - 1
    • Missing attribute check for settings.domain · Line 73-77
Additional Suggestions - 1
  • plugins/flytekit-bigquery/flytekitplugins/bigquery/connector.py - 1
    • Use built-in dict instead of typing.Dict · Line 3-3
Review Details
  • Files reviewed - 2 · Commit Range: d0bdc49..d0bdc49
    • plugins/flytekit-bigquery/flytekitplugins/bigquery/connector.py
    • plugins/flytekit-bigquery/flytekitplugins/bigquery/task.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

Refer to the documentation for additional commands.

Configuration

This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at haytham@union.ai.

Documentation & Help

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Copy Markdown
Contributor

flyte-bot commented Apr 17, 2025

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced BigQuery Connector for Custom User Agent

connector.py - Refactored imports and added user agent initialization using ClientInfo to pass domain and sdk_version info to the bigquery client.

task.py - Updated configuration to include a Domain field which supports the new user agent setup.

Testing - Updated Tests for Domain Configuration

test_bigquery.py - Modified test assertions to accommodate the new Domain field in the task_spec custom configuration.

test_connector.py - Added Domain key to task_config to ensure connector tests cover user agent and domain support.

Comment thread plugins/flytekit-bigquery/flytekitplugins/bigquery/task.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.58%. Comparing base (26db7a3) to head (d0bdc49).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3232      +/-   ##
==========================================
+ Coverage   74.77%   83.58%   +8.81%     
==========================================
  Files         295        3     -292     
  Lines       25725      195   -25530     
  Branches     2924        0    -2924     
==========================================
- Hits        19235      163   -19072     
+ Misses       5663       32    -5631     
+ Partials      827        0     -827     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

pingsutw
pingsutw previously approved these changes Apr 22, 2025
Copy link
Copy Markdown
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

Awesome, thank you @samhita-alla

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Future-Outlier
Future-Outlier previously approved these changes Apr 22, 2025
Copy link
Copy Markdown
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

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

is it backward compatible with old syntax?

@flyte-bot
Copy link
Copy Markdown
Contributor

flyte-bot commented Apr 22, 2025

Code Review Agent Run #e1e431

Actionable Suggestions - 0
Additional Suggestions - 2
  • plugins/flytekit-bigquery/tests/test_bigquery.py - 1
    • Test expects field not in BigQueryConfig definition · Line 46-46
  • plugins/flytekit-bigquery/tests/test_connector.py - 1
    • Unused Domain parameter in BigQuery task config · Line 62-62
Review Details
  • Files reviewed - 2 · Commit Range: d0bdc49..2174efe
    • plugins/flytekit-bigquery/tests/test_bigquery.py
    • plugins/flytekit-bigquery/tests/test_connector.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

Refer to the documentation for additional commands.

Configuration

This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at haytham@union.ai.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread plugins/flytekit-bigquery/flytekitplugins/bigquery/connector.py
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
@flyte-bot
Copy link
Copy Markdown
Contributor

flyte-bot commented Apr 22, 2025

Code Review Agent Run #cd796a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 2174efe..6e574ab
    • plugins/flytekit-bigquery/flytekitplugins/bigquery/connector.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

Refer to the documentation for additional commands.

Configuration

This repository uses code_review_bito You can customize the agent settings here or contact your Bito workspace admin at haytham@union.ai.

Documentation & Help

AI Code Review powered by Bito Logo

@samhita-alla samhita-alla merged commit 8a4a19a into master Apr 23, 2025
114 of 115 checks passed
Atharva1723 pushed a commit to Atharva1723/flytekit that referenced this pull request Oct 5, 2025
* add user agent to bigquery connector

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix test

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix test

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* make domain fetch optional

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

---------

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Atharva <atharvakulkarni172003@gmail.com>
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.

4 participants