feat: add first-class DateTime support#66
Merged
maskedsyntax merged 2 commits intomainfrom Mar 2, 2026
Merged
Conversation
… summaries
- type_inference.py: detect datetime64 dtypes and parse object columns
(>80% parseable via pd.to_datetime → classified as "DateTime"); datetime
detection runs before cardinality-based categorical check so date columns
with few unique values are not misclassified
- config.py: add DateTimeThresholds (parse threshold, future-date ratio,
gap multipliers, min rows) wired into HashPrepConfig
- checks/datetime_checks.py: three new checks —
- datetime_future_dates: flags values timestamped in the future
- datetime_gaps: detects anomalously large gaps vs. median gap
- datetime_monotonicity: warns when a high-uniqueness date column is
out of temporal order
- summaries/variables.py: enhance _summarize_datetime with weekday
distribution, hour distribution (sub-day precision), gap statistics,
monotonicity, future_count, and has_time_component flag; removed
deprecated infer_datetime_format argument across all callers
- checks/__init__.py + core/analyzer.py: register three new checks in
CHECKS registry and ALL_CHECKS list
- tests/test_datetime.py: 31 tests covering type inference, each check
unit, summary fields, and end-to-end DatasetAnalyzer integration
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type_inference.pynow detectsdatetime64native dtypes and auto-parses object columns (>80% parseable →"DateTime"). Detection runs before cardinality-based categorical classification, so date columns with few unique values are no longer misclassified.DateTimeThresholdsdataclass inconfig.pywith tunable parse threshold, future-date ratio, gap multipliers, and minimum row count.checks/datetime_checks.py:datetime_future_dates— flags values timestamped in the future (data entry errors, clock skew)datetime_gaps— detects anomalously large gaps vs. the median gap in a time seriesdatetime_monotonicity— warns when a high-uniqueness date column is out of temporal order_summarize_datetimenow includes weekday distribution, hour distribution (sub-day precision), gap statistics (median/mean/min/max gap), monotonicity, future value count, and ahas_time_componentflag.infer_datetime_formatargument from allpd.to_datetimecalls.tests/test_datetime.pycovering type inference, each check unit, summary fields, and end-to-endDatasetAnalyzerintegration. All 150 tests pass (119 existing + 31 new).Test plan
uv run pytest tests/test_datetime.py -v→ 31/31 passuv run pytest tests/ --ignore=tests/test_datetime.py→ 119/119 pass (no regressions)