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[Python-CDK]: Bump Pendulum #47266

Closed
wants to merge 3 commits into from

Conversation

aaronsteers
Copy link
Collaborator

@aaronsteers aaronsteers commented Oct 23, 2024

Continuation of:

What

Pendulum doesn't have wheels for <3.0. Bumping the Pendulum version should allow images to build correctly and more reliably on different platforms.

Breaking changes in Pendulum 3.0 described here:

Most connectors are unaffected. A few will need small changes, in their tests or in the connector code. We expect tests will uncover these issues, and mitigations should be straightforward.

Additionally, we can bump a few other dependencies while we are at it.

How

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Oct 23, 2024 3:24am

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Oct 23, 2024
@aaronsteers aaronsteers marked this pull request as ready for review October 23, 2024 03:55
@aaronsteers
Copy link
Collaborator Author

The ISO/RFC format seems to be modified in the latest pendulum version. This seems problematic:

image

@szemek
Copy link
Contributor

szemek commented Oct 23, 2024

@aaronsteers I made a small Python script

import sys
import pendulum

print("Python version:", sys.version)
print("pendulum version:", pendulum.__version__)

date = pendulum.datetime(2001, 5, 21, 12)
print(date.to_rfc3339_string())
print(f"{date}")

I got results:

Python version: 3.12.4 (main, Oct 23 2024, 22:01:10) [Clang 15.0.0 (clang-1500.3.9.4)]
pendulum version: 3.0.0
2001-05-21T12:00:00+00:00
2001-05-21 12:00:00+00:00
Python version: 3.10.4 (main, May 11 2022, 20:36:56) [Clang 13.1.6 (clang-1316.0.21.2.3)]
pendulum version: 2.1.2
2001-05-21T12:00:00+00:00
2001-05-21T12:00:00+00:00

Maybe problem is with implicit casting to string, because .to_rfc3339_string() method returns the same results for different pendulum versions.

@aaronsteers
Copy link
Collaborator Author

aaronsteers commented Oct 28, 2024

@szemek - The challenge here is that the default/defacto behavior will exist in many places (in the CDK and also in the connectors) to simply use the default string rendering: str(date) or basically using the class's __str__() method. Since these dates may be passed by object into a dictionary, and then only rendered in a final print of the dictionary itself, there is not a clear place where we would need to make the change(s). There could be issues also of state values being written out on a prior version of the connector with "T" delimiters and " " delimiters in a new version. If the comparison is alpha-based (and JSON does treat datetimes as strings), those comparisons would break in hard-to-detect ways.

For now, at least, I think we have to close this PR and rethink/regroup on this. Adding to the complexity here is that Pendulum 3.0 appears to be abandoned since January of this year. I can't make a strong case to move the CDK and all connectors over to 3.0 in this case - because of lack of support and also the breaking change in how datetimes are rendered by default.

Other options I am considering:

  1. Move to the newer, more active, and apparently much faster Whenever library.
  2. Moving to Arrow for dates, since it is also very fast and we have Arrow dependencies elsewhere already.

None of this is trivial because it all requires refactoring and retesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants