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

Update open-edx pipeline to match SQL file output for Simeon #622

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

quazi-h
Copy link
Contributor

@quazi-h quazi-h commented Mar 20, 2023

Description

Initial commit, adding TeamsMembership Query

Motivation and Context

Open edX data exports from Open Learning should conform to the edx-analytics-exporter interface output
#610

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (improves on existing behavior)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project. (Did you install and run the pre-commit hooks?)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Member

@blarghmatey blarghmatey left a comment

Choose a reason for hiding this comment

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

Looking good so far. A couple minor comments. In terms of PyPika vs. raw SQL I don't have a strong opinion on it. If it takes a little longer to write now but seems more maintainable in the future, then I'm happy to go that direction. If the SQL is faster and more maintainable then I'm happy with that option too.

Query.from_(course_team)
.join(teams_membership)
.on(course_team.id == teams_membership.team_id)
.select("teams_membership.*")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.select("teams_membership.*")
.select("teams_courseteammembership.*")

"""
wiki_article, wiki_urlpath = Tables("wiki_article", "wiki_urlpath")
subquery = (
Query.from(wiki_urlpath).as_("node").from(wiki_urlpath).as("parent")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Query.from(wiki_urlpath).as_("node").from(wiki_urlpath).as("parent")
Query.from_(wiki_urlpath).as_("node").from(wiki_urlpath).as("parent")

@pdpinch
Copy link
Member

pdpinch commented Aug 7, 2023

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