-
Notifications
You must be signed in to change notification settings - Fork 2
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
Clean date function for TargetExtra #30
base: main
Are you sure you want to change the base?
Conversation
Hi @brendanrmills -- many thanks for checking, and for the update! Actually, it's been a while I did not run a query -- but the team should resume soon on using the module for follow-up, so we will inspect carefully and add new features that we recently discussed. |
tom_fink/tests/tests.py
Outdated
# from tom_fink.fink import FinkQueryForm, FinkBroker | ||
|
||
test_alert1 = {, |
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.
Typo: there should not be comma here
@brendanrmills and @JulienPeloton Is this PR still live? |
Please merge this PR if there are no conflicts |
I would be tempted to merge the changes. However the CI is failing, and the fail happens early, at the metadata generation for the package:
I would log the error, and investigate in a separate branch. |
I noticed that if you wanted to save the contents of an alert into a bunch of TargetExtra objects to keep track of the parameters, the TargetExtra class would throw a RuntimeWarning
/home/bmills/bmillsWork/tom_test/new_venv/lib/python3.9/site-packages/django/db/models/fields/__init__.py:1534: RuntimeWarning:
DateTimeField TargetExtra.time_value received a naive datetime (2018-07-07 08:25:56.001000) while time zone support is active.
This was because TargetExtra casts the date as a datetime but it is common for django projects to require timezone information. This was fixed by adding a
clean_date()
method that just appends' UTC'
to the end of the firstdate and lastdate. I also wrote a small testing function to verify this.