Skip to content

Conversation

@mbertrand
Copy link
Member

@mbertrand mbertrand commented Jul 23, 2024

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/4931

Description (What does it do?)

Adjusts the functionlearning_resources.etl.load_runs so that archived runs have no prices.

How can this be tested?

  • Set EDX_API_ env values to the same as on RC
  • Run ./manage.py backpopulate_mit_edx_data (use the --api_datafile option if you already have a local json file of the mit_edx data).
  • Check that the following query returns just an empty list:
    from learning_resources.models import *
    LearningResourceRun.objects.filter(
      availability="Archived", 
      published=True, 
      learning_resource__etl_source="mit_edx"
    ).values_list("prices", flat=True).distinct()
    
    Out[3]: <TimestampedModelQuerySet [[]]>

Additional Context

I thought about adding a migration to set prices = [] for published runs with "Archived" availability, but for now I decided it would be a bit redundant since the ETL scripts run every day.

@mbertrand mbertrand added Needs Review An open Pull Request that is ready for review Work in Progress and removed Needs Review An open Pull Request that is ready for review Work in Progress labels Jul 23, 2024
@mbertrand mbertrand changed the title No prices for archived runs No prices for archived runs or resources w/out certificates Jul 23, 2024
@mbertrand mbertrand added Work in Progress Needs Review An open Pull Request that is ready for review and removed Needs Review An open Pull Request that is ready for review Work in Progress labels Jul 23, 2024
@abeglova abeglova self-assigned this Jul 25, 2024
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

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

👍

@mbertrand mbertrand force-pushed the mb/no_archived_run_prices branch from fe41619 to 9b12c25 Compare July 25, 2024 18:58
@mbertrand mbertrand merged commit 1a338c8 into main Jul 25, 2024
@mbertrand mbertrand deleted the mb/no_archived_run_prices branch October 23, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants