-
Notifications
You must be signed in to change notification settings - Fork 16.5k
feat(dates): adding handling for first of #37098
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
feat(dates): adding handling for first of #37098
Conversation
…andrusoare/feat/date-parse-improvements
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
We are not handling expressions like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review Agent Run #38d2ff
Actionable Suggestions - 1
-
tests/unit_tests/utils/date_parser_tests.py - 1
- Missing tzinfo argument in datetime call · Line 619-620
Review Details
-
Files reviewed - 2 · Commit Range:
e46d328..b244049- superset/utils/date_parser.py
- tests/unit_tests/utils/date_parser_tests.py
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
| result = get_since_until("first of this month : ") | ||
| assert result == (datetime(2016, 11, 1), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 620 creates a datetime object without tzinfo argument. Add timezone information using datetime(..., tzinfo=timezone.utc) or the project's preferred timezone handling approach.
Code suggestion
Check the AI-generated fix before applying
| result = get_since_until("first of this month : ") | |
| assert result == (datetime(2016, 11, 1), None) | |
| result = get_since_until("first of this month : ") | |
| from datetime import timezone | |
| assert result == (datetime(2016, 11, 1, tzinfo=timezone.utc), None) |
Code Review Run #38d2ff
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
I have also been looking into alternatives for a library that could handle all of these cases so in the future we won t have to add these manually, I have tested the dateparser library but it doesn't cover all of our needs |
|
🎪 Showtime deployed environment on GHA for b244049 • Environment: http://44.251.130.183:8080 (admin/admin) |
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
CodeAnt AI finished reviewing your PR. |
|
🎪 Showtime deployed environment on GHA for a6f1871 • Environment: http://16.148.67.235:8080 (admin/admin) |
Code Review Agent Run #921248Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Add support for parsing "first of the month" and similar expressions in time filters.
Single date expressions:
Range expressions:
The key distinction is that "first of X" and "first day of X" return a single date, while "first week/month/quarter of X" returns a date range.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE
AFTER
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION