fix: Replace pendulum with ab_datetime_now() and fix linting issues#733
Conversation
- Replace pendulum.now().format() calls with ab_datetime_now().strftime() in progress.py - Add noqa comment for intentional private member access in sources/base.py - Fix line length violation in progress.py - Apply ruff formatting to both files Fixes CI failures in stream preview functionality. Co-Authored-By: AJ Steers <aj@airbyte.io>
Original prompt from AJ Steers |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1753943347-fix-ci-failures' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1753943347-fix-ci-failures'Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
Community SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes CI failures in PR #725 by replacing missing pendulum imports with the ab_datetime_now() utility function and addressing linting violations. The changes enable the stream preview functionality to pass CI checks.
- Replaced three instances of
pendulum.now().format('HH:mm:ss')withab_datetime_now().strftime('%H:%M:%S') - Fixed linting issues including private member access warning and line length violations
- Applied consistent code formatting to improve readability
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| airbyte/sources/base.py | Added noqa comment for intentional private member access and reformatted code for line length compliance |
| airbyte/progress.py | Replaced pendulum datetime calls with ab_datetime_now() and fixed string formatting for readability |
|
Copilot pointed out we have some missing import statements. |
Co-Authored-By: AJ Steers <aj@airbyte.io>
f0d90f7
into
aj/feat/stream-previews
fix: Replace pendulum with ab_datetime_now() and fix linting issues
This PR targets the following PR:
Summary
Fixes CI failures in PR #725 that were blocking the stream preview functionality. The failures were caused by:
airbyte/progress.pyusedpendulum.now().format()without importing pendulumKey Changes:
pendulum.now().format('HH:mm:ss')withab_datetime_now().strftime('%H:%M:%S')in 3 locations (following existing codebase pattern)# noqa: SLF001comment to suppress intentional private member access warningReview & Testing Checklist for Human
ab_datetime_now().strftime('%H:%M:%S')produces identical output topendulum.now().format('HH:mm:ss')ab_datetime_now()aligns with the intended "whenever" replacement mentioned in the original contextRecommended Test Plan:
poetry run pytest tests/unit_tests/test_lowcode_connectors.py::test_nocode_execution -vpoetry run pytest tests/unit_tests/ -vDiagram
%%{ init : { "theme" : "default" }}%% graph TD source["airbyte/sources/base.py<br/>(Minor Edit)"]:::minor-edit progress["airbyte/progress.py<br/>(Major Edit)"]:::major-edit test["tests/unit_tests/test_lowcode_connectors.py<br/>(Context)"]:::context datetime["airbyte_cdk.utils.datetime_helpers<br/>(Context)"]:::context source -->|"calls _log_sync_cancel()"| progress progress -->|"imports ab_datetime_now"| datetime test -->|"executes source.read()"| source progress -->|"formats timestamps"| progress subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
ab_datetime_now()pattern based on existing codebase usage, though original context mentioned "whenever" replacementThe changes are mechanical replacements following established patterns in the codebase, but human verification of the datetime format equivalence and broader testing is recommended to ensure no subtle regressions.