Skip to content

docs: replace removed dst_rule timezone examples - #1053

Open
Hugohong258 wants to merge 1 commit into
python-pendulum:masterfrom
Hugohong258:docs-timezone-fold
Open

Hugohong258 wants to merge 1 commit into
python-pendulum:masterfrom
Hugohong258:docs-timezone-fold

Conversation

@Hugohong258

Copy link
Copy Markdown

Description

The timezone guide still calls dst_rule and transition constants removed in Pendulum 3, so those examples raise AttributeError or TypeError. Replace them with fold and raise_on_unknown_times, including both normalization and direct Timezone.convert() usage. Keep the original naive datetime when demonstrating the two fold choices, and note the Pendulum 2-to-3 API change.

Related to #789. Runtime behavior and the rest of the documentation migration are unchanged.

Validation

Executed 13 statements from the exact edited examples and 18 timezone behavior controls against the current source under Python 3.12.3 with PENDULUM_EXTENSIONS=0. The existing timezone/construction tests pass: 56 passed, 2 skipped. The Rust extension and complete test matrix were not built or run.

MkDocs strict builds pass using an external configuration that resolves the existing source/theme/include paths, and the updated examples are present in both the combined index and timezone page. The repository's unchanged configuration also exits successfully but prints include-path warnings; it still labels the docs as 2.1. This PR does not update that configuration or claim that the live website has been migrated. git diff --check passes.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

Documentation-only change; the examples were executed against the existing implementation.

This branch has not been deployed

No deployments
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