FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix pendulum.parse('now', tz='...') ignoring the time zone by pR0Ps · Pull Request #701 · python-pendulum/pendulum · GitHub

Fix pendulum.parse('now', tz='...') ignoring the time zone - #701

Merged
Secrus merged 1 commit into
python-pendulum:masterfrom
pR0Ps:bugfix/parse-now-timezone
Apr 24, 2025
Merged

Fix pendulum.parse('now', tz='...') ignoring the time zone#701
Secrus merged 1 commit into
python-pendulum:masterfrom
pR0Ps:bugfix/parse-now-timezone

Conversation

pR0Ps commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code (nothing to update - as far as I can tell this isn't mentioned in it).

Previously, using "now" with pendulum.parse short-circuited all other parsing logic (expected), including the time zone (not expected).

Example using the latest release:

>>> import pendulum
>>> pendulum.__version__
'2.1.2'
>>> pendulum.parse("2023-04-04", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'
>>> pendulum.parse("now", tz="America/Los_Angeles").format("z (Z)")
'Etc/UTC (-00:00)'

The same example after this PR:

>>> import pendulum
>>> pendulum.__version__
'3.0.0a'
>>> pendulum.parse("2023-04-04", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'
>>> pendulum.parse("now", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'

codspeed-hq Bot commented Apr 5, 2023
edited
Loading

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #701 will not alter performance

Comparing pR0Ps:bugfix/parse-now-timezone (305f80f) with master (1034b18)

Summary

✅ 1 untouched benchmarks

Comment thread tests/test_parsing.py Outdated

pR0Ps commented Sep 9, 2024

Copy link
Copy Markdown
Contributor Author

@edgarrmondragon Anything else for me to do on this?

Copy link
Copy Markdown
Contributor

@edgarrmondragon Anything else for me to do on this?

I'll preface saying I'm not a maintainer of this repo, so my approval is only nominal 🙂.

This LGTM, there's a Rust linting error but I don't know if it's related to changes in this PR.

Secrus commented Apr 23, 2025

Copy link
Copy Markdown
Collaborator

Hi. Sorry for the delays, we are digging ourselves out of the pile of code debt. Could you please rebase your changes with the master branch so we can review and merge them?

pR0Ps commented Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

@Secrus rebased on latest master

Secrus merged commit 9826867 into python-pendulum:master Apr 24, 2025
pR0Ps deleted the bugfix/parse-now-timezone branch April 24, 2025 12:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL