Skip to content

REF: Remove TimedeltaArray._from_sequence_not_strict#65162

Merged
mroeschke merged 1 commit intopandas-dev:mainfrom
jbrockmendel:ref-not_strict
Apr 11, 2026
Merged

REF: Remove TimedeltaArray._from_sequence_not_strict#65162
mroeschke merged 1 commit intopandas-dev:mainfrom
jbrockmendel:ref-not_strict

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • Remove TimedeltaArray._from_sequence_not_strict, which was _from_sequence plus freq pinning
  • Move _maybe_pin_freq call to TimedeltaIndex.__new__, keeping _from_sequence with the standard EA signature

Test plan

  • pandas/tests/indexes/timedeltas/ pass
  • pandas/tests/arrays/timedeltas/ pass
  • pandas/tests/arrays/test_timedeltas.py passes
  • pandas/tests/arrays/test_datetimelike.py passes
  • Pre-commit hooks pass

🤖 Generated with Claude Code

Move freq pinning to TimedeltaIndex.__new__ so the array constructor
uses only the standard _from_sequence signature.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbrockmendel jbrockmendel added the Refactor Internal refactoring of code label Apr 11, 2026
@mroeschke mroeschke added this to the 3.1 milestone Apr 11, 2026
@mroeschke mroeschke merged commit 7b9838e into pandas-dev:main Apr 11, 2026
51 checks passed
@mroeschke
Copy link
Copy Markdown
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-not_strict branch April 11, 2026 18:03
Sharl0tteIsTaken added a commit to Sharl0tteIsTaken/pandas that referenced this pull request Apr 12, 2026
…-comparison

* upstream/main:
  CI: Add repo flag to GHA cache cleaup workflow (pandas-dev#65167)
  DOC: clarify unit parameter in to_datetime docstring (pandas-dev#65155)
  BUG: raise clear TypeError for ExtensionArray.fillna with dict value (pandas-dev#65157)
  REF: consolidate __iter__ into TimelikeOps, standardize _validate_setitem_value (pandas-dev#65158)
  REF: Remove TimedeltaArray._from_sequence_not_strict (pandas-dev#65162)
  TST: mark test_dt64arr_cmp_arraylike_invalid[tzlocal] xfail on Windows (pandas-dev#64294)
  DOC: Add User Guide link to qcut docstring (pandas-dev#62357) (pandas-dev#63856)
  DOC: Update documentation for apply function behavior (pandas-dev#64236)
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Apr 14, 2026
…ith_freq logic to Index

- Remove freq parameter from DTA._from_sequence_not_strict; it no longer
  reads data.freq or calls _maybe_pin_freq
- DTI.__new__ now extracts freq from incoming data and calls _maybe_pin_freq
  externally, following the pattern established for TDI in pandas-dev#65162
- Move _with_freq freq-resolution logic to DatetimeTimedeltaMixin._with_freq
  so the Index resolves "infer" before delegating to the array
- Relax array _with_freq to accept BaseOffset on non-empty arrays (needed
  since the Index now resolves "infer" to an offset before passing down)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Apr 15, 2026
…ith_freq logic to Index

- Remove freq parameter from DTA._from_sequence_not_strict; it no longer
  reads data.freq or calls _maybe_pin_freq
- DTI.__new__ now extracts freq from incoming data and calls _maybe_pin_freq
  externally, following the pattern established for TDI in pandas-dev#65162
- Move _with_freq freq-resolution logic to DatetimeTimedeltaMixin._with_freq
  so the Index resolves "infer" before delegating to the array
- Relax array _with_freq to accept BaseOffset on non-empty arrays (needed
  since the Index now resolves "infer" to an offset before passing down)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants