Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add python 3.12 support #596

Merged
merged 7 commits into from
Jan 29, 2025
Merged

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Jan 29, 2025

Summary by CodeRabbit

  • Tests
    • Added Python 3.12 to the testing matrix for enhanced compatibility and testing coverage
  • Dependencies
    • Updated airbyte-cdk dependency version from ^6.9.0 to ^6.28.0
    • Removed version constraint for pendulum dependency
  • Enhancements
    • Improved message structure in Airbyte message handling with additional fields for better processing and logging
    • Enhanced logging functionality by refining date handling and improving error messaging
    • Updated timestamp handling in logging methods to utilize a custom datetime function

Copy link

coderabbitai bot commented Jan 29, 2025

📝 Walkthrough

Walkthrough

The pull request introduces Python 3.12 to the existing GitHub Actions workflow for pytest testing, expanding the testing matrix to include the latest Python version. Additionally, the pyproject.toml file is updated to reflect a significant upgrade of the airbyte-cdk dependency from ^6.9.0 to ^6.28.0 and the removal of the version constraint for the pendulum dependency. The overall structure of the workflow and other components remains intact, with modifications focused on these updates.

Changes

File Change Summary
.github/workflows/python_pytest.yml Added Python 3.12 to the python-version matrix for the pytest job
pyproject.toml Updated airbyte-cdk dependency from ^6.9.0 to ^6.28.0; removed version constraint for pendulum
airbyte/_message_iterators.py Modified _new_stream_success_message function to use ab_datetime_now().timestamp() for emitted_at; added new fields to AirbyteMessage
airbyte/logs.py Removed pendulum import; updated date formatting to use ab_datetime_now(); enhanced warning handling in warn_once
airbyte/progress.py Replaced pendulum usage with ab_datetime_now() for logging timestamps

Possibly related PRs

Suggested reviewers

  • aaronsteers

Is there anything specific you would like to explore further about these changes? 😊


📜 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 8254c66 and ac8a733.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Analyze (python)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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 or @coderabbitai title 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/python_pytest.yml (1)

Line range hint 31-195: I noticed different Poetry versions across jobs - wdyt about aligning them?

  • pytest-fast uses Poetry 2.0.1
  • Other jobs use Poetry 1.7.1

Would you like to standardize on Poetry 2.0.1 across all jobs since it's the newer version? This could help maintain consistency. 🤔

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 778ceca and 9d6b76c.

📒 Files selected for processing (1)
  • .github/workflows/python_pytest.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
🔇 Additional comments (1)
.github/workflows/python_pytest.yml (1)

136-136: LGTM on adding Python 3.12! Just a quick verification needed.

Let's make sure our dependencies are compatible with Python 3.12. Would you like me to help verify this? 🤔

✅ Verification successful

Looking good for Python 3.12! Just a small heads-up about airbyte-cdk 🔍

Most of our critical dependencies (pandas, SQLAlchemy, Snowflake, BigQuery) explicitly support Python 3.12. While airbyte-cdk doesn't advertise explicit support yet, our version constraints in pyproject.toml look safe. Would you like to test the airbyte-cdk integration specifically with Python 3.12 during the rollout? 🤔

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check package compatibility with Python 3.12

# Get package dependencies from pyproject.toml
echo "Checking pyproject.toml dependencies..."
cat pyproject.toml | grep -A 50 "^\[tool.poetry.dependencies\]"

# Check if any dependencies have known Python 3.12 compatibility issues
echo "Checking PyPI for Python 3.12 classifiers..."
while IFS= read -r package; do
  if [[ $package =~ ^[a-zA-Z0-9-]+= ]]; then
    pkg_name=$(echo "$package" | cut -d'=' -f1)
    curl -s "https://pypi.org/pypi/${pkg_name}/json" | \
    jq -r '.info.classifiers[] | select(contains("Programming Language :: Python :: 3.12"))'
  fi
done < <(cat pyproject.toml | grep -A 50 "^\[tool.poetry.dependencies\]")

Length of output: 1886


Script:

#!/bin/bash
# Check Python 3.12 compatibility for critical dependencies

echo "Checking critical dependencies..."
PACKAGES=(
    "airbyte-cdk"
    "duckdb"
    "pandas"
    "sqlalchemy"
    "snowflake-connector-python"
    "google-cloud-bigquery"
)

for pkg in "${PACKAGES[@]}"; do
    echo "=== Checking $pkg ==="
    curl -s "https://pypi.org/pypi/${pkg}/json" | \
    jq -r --arg pkg "$pkg" '
        if (.info.classifiers | any(contains("Programming Language :: Python :: 3.12")))
        then "\($pkg): ✓ Supports Python 3.12"
        else "\($pkg): ⚠️ No explicit Python 3.12 support found"
        end'
done

Length of output: 2861

@aaronsteers
Copy link
Contributor Author

aaronsteers commented Jan 29, 2025

/fix-pr

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.
(This job requires that the PR author has "Allow edits from maintainers" enabled.)

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d27fb9 and a126d50.

📒 Files selected for processing (2)
  • airbyte/logs.py (3 hunks)
  • airbyte/progress.py (5 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
airbyte/logs.py

18-18: time.strptime imported but unused

Remove unused import: time.strptime

(F401)


26-26: airbyte_cdk.utils.datetime_helpers.ab_datetime_format imported but unused

Remove unused import: airbyte_cdk.utils.datetime_helpers.ab_datetime_format

(F401)

🪛 GitHub Actions: Run Linters
airbyte/logs.py

[error] 12-29: Import block is un-sorted or un-formatted


[error] 18-18: Unused import: time.strptime


[error] 26-26: Unused import: airbyte_cdk.utils.datetime_helpers.ab_datetime_format

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Pytest (All, Python 3.12, Windows)
  • GitHub Check: Pytest (All, Python 3.12, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
🔇 Additional comments (3)
airbyte/logs.py (2)

65-65: LGTM! Clear stack level handling.

The explicit setting of stacklevel=0 when with_stack is False improves code clarity.


Line range hint 413-414: LGTM! Consistent datetime handling.

The changes consistently replace pendulum with ab_datetime_now().strftime() for timestamp formatting, aligning with the PR objective to add Python 3.12 support by removing the pendulum dependency.

Also applies to: 427-427, 433-434, 540-541, 558-559

🧰 Tools
🪛 Ruff (0.8.2)

18-18: time.strptime imported but unused

Remove unused import: time.strptime

(F401)


26-26: airbyte_cdk.utils.datetime_helpers.ab_datetime_format imported but unused

Remove unused import: airbyte_cdk.utils.datetime_helpers.ab_datetime_format

(F401)

🪛 GitHub Actions: Run Linters

[error] 18-18: Unused import: time.strptime


[error] 26-26: Unused import: airbyte_cdk.utils.datetime_helpers.ab_datetime_format

airbyte/progress.py (1)

35-35: LGTM! Clean import addition.

The addition of ab_datetime_now import aligns with the changes to remove pendulum dependency.

airbyte/logs.py Outdated Show resolved Hide resolved
@aaronsteers aaronsteers marked this pull request as ready for review January 29, 2025 06:03
@aaronsteers aaronsteers enabled auto-merge (squash) January 29, 2025 06:03
@aaronsteers
Copy link
Contributor Author

aaronsteers commented Jan 29, 2025

/poetry-lock

poetry lock job started... Check job output.

poetry lock applied successfully.

@aaronsteers aaronsteers merged commit cc2c533 into main Jan 29, 2025
19 of 21 checks passed
@aaronsteers aaronsteers deleted the aj/chore/add-py312-support branch January 29, 2025 16:45
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.

1 participant