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

Added CourseDailyMetrics #13

Merged
merged 12 commits into from
Apr 24, 2018
Merged

Added CourseDailyMetrics #13

merged 12 commits into from
Apr 24, 2018

Conversation

johnbaldwin
Copy link
Contributor

  • Added the model, serializer, filter, view and tests for each
  • Added CourseDailyMetrics to the admin interface

- Added model
- Added migration
- Added test fixture and basic model test
- Added an is_close helper method to compare floating point values. See
the method docstring for more information
- Added course_id to test data
- Added new test to check unique together constraint
- Added placeholder tests for future implementation
- Also added 'create_metrics_model_timeseries' method to tests/helpers
@bryanlandia
Copy link
Contributor

@johnbaldwin Would you mind squashing the commits and pushing again?

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (john/site-daily-metrics@09826d6). Click here to learn what that means.
The diff coverage is 93.78%.

Impacted file tree graph

@@                    Coverage Diff                     @@
##             john/site-daily-metrics      #13   +/-   ##
==========================================================
  Coverage                           ?   93.64%           
==========================================================
  Files                              ?       25           
  Lines                              ?      614           
  Branches                           ?        0           
==========================================================
  Hits                               ?      575           
  Misses                             ?       39           
  Partials                           ?        0
Impacted Files Coverage Δ
edx_figures/admin.py 0% <0%> (ø)
edx_figures/urls.py 0% <0%> (ø)
edx_figures/views.py 96.36% <100%> (ø)
...dx_figures/migrations/0002_course_daily_metrics.py 100% <100%> (ø)
tests/views/test_course_daily_metrics_view.py 100% <100%> (ø)
edx_figures/serializers.py 100% <100%> (ø)
tests/helpers.py 100% <100%> (ø)
edx_figures/filters.py 100% <100%> (ø)
tests/factories.py 95% <100%> (ø)
tests/test_models.py 91.17% <86.95%> (ø)
... and 3 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 09826d6...aa5dc1f. Read the comment docs.

Copy link
Contributor

@bryanlandia bryanlandia left a comment

Choose a reason for hiding this comment

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

Looks great, all the tests pass for me! Just the one minor comment about use of the @python_2_unicode_compatible decorator and __str__.

# Any other data we want?

def __str__(self):
return "id:{}, date_for:{}, course_id:{}".format(
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like __str__ returns unicode, and you're using @python2_unicode_compatible. Same on next method. Don't you need to return u"id:{}...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bryanlandia Good find. The docs are weak. They should specify that str needs to be defined as unicode. See: https://github.com/django/django/blob/stable/1.8.x/django/utils/encoding.py#L28

For ref, here the doc for the decorator:

https://docs.djangoproject.com/en/1.8/ref/utils/#module-django.utils.encoding

So I'll create an issue to fix this globally after we've got these PRs merged to develop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created an issue to track that this needs to get fixed: #18

@johnbaldwin johnbaldwin changed the base branch from john/site-daily-metrics to develop April 24, 2018 21:51
@johnbaldwin johnbaldwin merged commit 1ad24e3 into develop Apr 24, 2018
@johnbaldwin johnbaldwin deleted the john/course-daily-metrics branch April 24, 2018 22:14
johnbaldwin pushed a commit that referenced this pull request Nov 2, 2020
…upgrade-2

Merge Appsembler master changes to 0.3.19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants