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: serialize datetime objects as strings #52

Merged
merged 2 commits into from
May 22, 2024
Merged

fix: serialize datetime objects as strings #52

merged 2 commits into from
May 22, 2024

Conversation

Ian2012
Copy link
Contributor

@Ian2012 Ian2012 commented May 16, 2024

Description

This PR fixes an issue when serializing as JSON the course data where some attributes were dates cannot be encoded by default. We use the code from event-tracking to allow the serialization of datetime objects as JSON.

@openedx-webhooks
Copy link

Thanks for the pull request, @Ian2012! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 16, 2024
@Ian2012 Ian2012 requested a review from bmtcril May 16, 2024 19:44
Copy link

github-actions bot commented May 16, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  platform_plugin_aspects
  __init__.py
  platform_plugin_aspects/extensions
  filters.py
  platform_plugin_aspects/management/commands
  load_test_tracking_events.py
  monitor_load_test_tracking.py
  platform_plugin_aspects/sinks
  serializers.py 30, 32-35
Project Total  

This report was generated by python-coverage-comment-action

@bmtcril
Copy link
Contributor

bmtcril commented May 21, 2024

I'd rather not bring in event-tracking and all of its sub-dependencies just for this one small class that has basically not changed in 11 yrs. I'd rather just copy it in, or use an altered version of the accepted SO answer with the addition of the very good UTC changes from event-tracking.

@Ian2012 Ian2012 force-pushed the cag/serializer branch 3 times, most recently from 170b6bc to f04b5ce Compare May 22, 2024 16:38
chore: quality fixes

chore: remove print statement

chore: quality fixes

refactor: do not use eventtracking date serializer
Copy link
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

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

👍

@Ian2012 Ian2012 merged commit 99bcf4e into main May 22, 2024
10 checks passed
@Ian2012 Ian2012 deleted the cag/serializer branch May 22, 2024 16:59
@openedx-webhooks
Copy link

@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants