Skip to content

Allow newer versions of arrow odbc and fix tests that return time field.#27

Open
landwehrj wants to merge 3 commits into
mainfrom
arrow-odbc
Open

Allow newer versions of arrow odbc and fix tests that return time field.#27
landwehrj wants to merge 3 commits into
mainfrom
arrow-odbc

Conversation

@landwehrj

Copy link
Copy Markdown
Contributor

No description provided.

@landwehrj landwehrj self-assigned this Feb 10, 2026
@landwehrj landwehrj added the enhancement New feature or request label Feb 10, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @landwehrj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on improving dependency management and test reliability. It updates the arrow_odbc dependency to allow for broader compatibility with newer versions, moving from a fixed version to a more flexible requirement. Concurrently, it rectifies issues in existing tests where time values were being incorrectly asserted as strings rather than proper datetime.time objects, ensuring accurate data type handling in ODBC connector tests.

Highlights

  • Dependency Update: The arrow_odbc dependency has been updated to remove the strict version constraint, allowing for newer versions of the library to be used.
  • Test Fixes: Several tests in test_odbc_connector.py were modified to correctly handle time fields, changing string representations of time to datetime.time objects.
  • Connection String Adjustment: A minor adjustment was made to the database connection string password in the test setup.
Changelog
  • docs/requirements.txt
    • Removed strict version pinning for arrow_odbc.
  • setup.cfg
    • Removed strict version pinning for arrow_odbc in odbc extra requirements.
  • test/test_odbc_connector.py
    • Corrected the password in the MariaDB connection string for test setup.
    • Modified multiple test assertions to use datetime.time objects instead of string literals for time values.
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the arrow_odbc dependency to allow newer versions and fixes tests to accommodate changes in the returned data types. My review focuses on improving dependency management practices and test configuration. I've suggested specifying a minimum version for arrow_odbc instead of unpinning it completely to ensure future compatibility. I also recommend avoiding hardcoded credentials in the test connection string for better security and maintainability.

Comment thread docs/requirements.txt
xgt
pandas
arrow_odbc==0.2.0
arrow_odbc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Unpinning a dependency completely can lead to unexpected build failures if a future version introduces breaking changes. It's better to specify a minimum version to ensure a baseline of compatibility while still allowing newer, non-breaking versions.

arrow_odbc>=0.2.0

Comment thread setup.cfg

[options.extras_require]
odbc = arrow_odbc==0.2.0
odbc = arrow_odbc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For better dependency management and to prevent potential issues for users installing this extra, it's advisable to specify a minimum version for arrow_odbc rather than leaving it unpinned. This ensures compatibility while allowing for updates.

odbc = arrow_odbc>=0.2.0

Comment thread test/test_odbc_connector.py Outdated
@classmethod
def _setup_connector(cls):
connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=foo;'
connection_string = 'Driver={MariaDB};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd=test;'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding credentials, even for a local test database, is a security risk and reduces configuration flexibility. It's recommended to load sensitive information like passwords from environment variables. For example:

import os

password = os.getenv('MARIADB_TEST_PWD', 'test')
connection_string = f'Driver={{MariaDB}};Server=127.0.0.1;Port=3306;Database=test;Uid=test;Pwd={password};'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/gemini It's creating the docker image there during the test?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, the _setup_connector method itself doesn't create the Docker image. This method is responsible for defining the connection string to a MariaDB instance. Typically, in a test environment like this, the MariaDB Docker container would be spun up by a test fixture (often defined in conftest.py) before these tests run.

My suggestion to use an environment variable for the password (MARIADB_TEST_PWD) is still relevant. It allows you to configure the password for the test database (whether it's a Docker container or another setup) externally, making the test suite more flexible and secure. For example, if the Docker container's password changes, you only need to update the environment variable, not the code.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant