Skip to content
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

fix: date picker support date unit with singular and plural #13330

Merged
merged 2 commits into from Feb 25, 2021

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Feb 25, 2021

SUMMARY

fix date picker does not support singular data unit

closed: #13264

TEST PLAN

Added UT for this case

ADDITIONAL INFORMATION

Comment on lines 91 to 94
result = get_since_until("Last 5 month")
expected = datetime(2016, 6, 7), datetime(2016, 11, 7)
self.assertEqual(result, expected)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this UT test for the correct singular case "Last 1 month"? Having the "Last 5 month" test is probably a good additional test, but less important IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for reminding me. Because there is Last 5 months UT case now, so added a Last 5 month(This syntax is wrong ). singular and plural time units are now supported. Although sometimes the syntax is incorrect.

Comment on lines 99 to 102
result = get_since_until("Next 5 month")
expected = datetime(2016, 11, 7), datetime(2017, 4, 7)
self.assertEqual(result, expected)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@codecov
Copy link

codecov bot commented Feb 25, 2021

Codecov Report

Merging #13330 (862f64e) into master (99a0c8a) will increase coverage by 3.68%.
The diff coverage is 90.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13330      +/-   ##
==========================================
+ Coverage   77.15%   80.84%   +3.68%     
==========================================
  Files         866      300     -566     
  Lines       45005    24420   -20585     
  Branches     5357        0    -5357     
==========================================
- Hits        34723    19742   -14981     
+ Misses      10159     4678    -5481     
+ Partials      123        0     -123     
Flag Coverage Δ
cypress ?
javascript ?
python 80.84% <90.57%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/reports/commands/log_prune.py 0.00% <ø> (ø)
superset/utils/cache.py 76.34% <ø> (ø)
superset/utils/date_parser.py 96.87% <ø> (ø)
superset/connectors/druid/models.py 82.06% <50.00%> (-0.08%) ⬇️
superset/reports/notifications/slack.py 83.72% <71.42%> (-5.47%) ⬇️
superset/common/query_context.py 82.06% <75.00%> (-2.73%) ⬇️
superset/common/query_object.py 90.27% <81.25%> (-1.27%) ⬇️
superset/connectors/sqla/models.py 90.54% <87.50%> (-0.04%) ⬇️
superset/utils/core.py 88.45% <92.85%> (+0.18%) ⬆️
superset/reports/notifications/email.py 97.87% <93.33%> (-2.13%) ⬇️
... and 540 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99a0c8a...366a977. Read the comment docs.

@zhaoyongjie zhaoyongjie merged commit 94d0bb9 into apache:master Feb 25, 2021
@junlincc junlincc added the explore:time Related to the time filters in Explore label Feb 26, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
…3330)

* fix: date picker support date unit with singular and plural

* fix grammar
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels explore:time Related to the time filters in Explore size/S 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Explore] Time picker not able to parse "Last 1 year"
4 participants