-
Notifications
You must be signed in to change notification settings - Fork 52
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: improve import file to calendar and extend capabilities #201
feat: improve import file to calendar and extend capabilities #201
Conversation
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.
Great job! Added few of my insights :)
app/internal/import_file.py
Outdated
check_date = datetime.datetime.strptime(date, DATE_FORMAT) | ||
except ValueError: | ||
check_date = change_string_to_date(date) | ||
if check_date is False: |
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.
Prefer == False
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.
changed it to not
if this is ok.
date1 = datetime.datetime.strptime(date, DATE_FORMAT2) | ||
else: | ||
date1 = datetime.datetime.strptime(date, DATE_FORMAT) | ||
except ValueError: |
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.
What is the purpose of the except here?
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.
if the string is not a valid date datetime.strptime
will fail to transform the string to date and we want to catch it.
Codecov Report
@@ Coverage Diff @@
## develop #201 +/- ##
===========================================
+ Coverage 99.36% 99.39% +0.02%
===========================================
Files 36 37 +1
Lines 1418 1485 +67
===========================================
+ Hits 1409 1476 +67
Misses 9 9
Continue to review full report at Codecov.
|
This is an extension for import to calendar:
what's new?
files must be in the following structure or the old structure (without Location)
the new rules we set (can be changed through a global variable):
Additional tests added: