diff --git a/logs/dbt.log b/logs/dbt.log new file mode 100644 index 000000000..db1f03631 --- /dev/null +++ b/logs/dbt.log @@ -0,0 +1,16 @@ +17:02:16.333324 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} + + +============================== 17:02:16.336997 | c9e4b7ca-f97c-48a7-9dfe-89aee8ad9c0f ============================== +17:02:16.336997 [info ] [MainThread]: Running with dbt=1.11.12 +17:02:16.337420 [debug] [MainThread]: running dbt with arguments {'log_format': 'default', 'warn_error': 'None', 'introspect': 'True', 'no_print': 'None', 'quiet': 'False', 'use_colors': 'True', 'cache_selected_only': 'False', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'log_path': 'logs', 'indirect_selection': 'eager', 'profiles_dir': '/Users/qhoque/.dbt', 'partial_parse': 'True', 'write_json': 'True', 'empty': 'False', 'use_experimental_parser': 'False', 'static_parser': 'True', 'target_path': 'None', 'log_cache_events': 'False', 'fail_fast': 'False', 'invocation_command': 'dbt compile --target dev --select marts__micromasters_dedp_exam_grades', 'debug': 'False', 'printer_width': '80', 'send_anonymous_usage_stats': 'True', 'version_check': 'True'} +17:02:16.337813 [error] [MainThread]: Encountered an error: +Runtime Error + No dbt_project.yml found at expected path /private/tmp/ol-data-platform/dbt_project.yml + Verify that each entry within packages.yml (and their transitive dependencies) contains a file named dbt_project.yml + +17:02:16.338215 [debug] [MainThread]: Resource report: {"command_name": "compile", "command_success": false, "command_wall_clock_time": 0.058058582, "process_in_blocks": "0", "process_kernel_time": 0.195369, "process_mem_max_rss": "121487360", "process_out_blocks": "0", "process_user_time": 0.919255} +17:02:16.338519 [debug] [MainThread]: Command `dbt compile` failed at 17:02:16.338466 after 0.06 seconds +17:02:16.338713 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} +17:02:16.338893 [debug] [MainThread]: Flushing usage events +17:02:16.527810 [debug] [MainThread]: An error was encountered while trying to flush usage events diff --git a/src/ol_dbt/models/marts/micromasters/marts__micromasters_dedp_exam_grades.sql b/src/ol_dbt/models/marts/micromasters/marts__micromasters_dedp_exam_grades.sql index 2a1190c53..1156e729b 100644 --- a/src/ol_dbt/models/marts/micromasters/marts__micromasters_dedp_exam_grades.sql +++ b/src/ol_dbt/models/marts/micromasters/marts__micromasters_dedp_exam_grades.sql @@ -10,6 +10,31 @@ with micromasters_exam_grades as ( select * from {{ ref('int__micromasters__users') }} ) +-- semester + passing_grade for MITxOnline proctored exam runs are now sourced from +-- dim_course_run (added in #2319) instead of being re-derived here. The pure MicroMasters +-- branch below (micromasters_exam_grades) still reads these fields directly from +-- int__micromasters__dedp_proctored_exam_grades because those exam runs are not represented +-- in dim_course_run until MicroMasters grades are added to tfact_grade (tracked in epic #2072). +-- Guard against dim_course_run SCD2 expiration gap: multiple is_current=true rows +-- for the same courserun_readable_id can fan out mitxonline_exam_grades rows. +-- Pick the latest, matching the established pattern in dim_product. +, mitxonline_courserun_metadata as ( + select courserun_readable_id, semester, passing_grade + from ( + select + courserun_readable_id + , semester + , passing_grade + , row_number() over ( + partition by courserun_readable_id + order by effective_date desc nulls last + ) as _row_num + from {{ ref('dim_course_run') }} + where platform = 'mitxonline' and is_current + ) + where _row_num = 1 +) + select course_number , course_title @@ -36,12 +61,14 @@ select , mitxonline_exam_grades.user_full_name , micromasters_users.user_email as user_micromasters_email , mitxonline_exam_grades.user_email as user_mitxonline_email - , mitxonline_exam_grades.proctoredexamgrade_passing_grade + , mitxonline_courserun_metadata.passing_grade as proctoredexamgrade_passing_grade , mitxonline_exam_grades.proctoredexamgrade_grade as proctoredexamgrade_percentage_grade , mitxonline_exam_grades.proctoredexamgrade_created_on - , mitxonline_exam_grades.semester + , mitxonline_courserun_metadata.semester from mitxonline_exam_grades left join micromasters_users on mitxonline_exam_grades.user_username = micromasters_users.user_mitxonline_username +left join mitxonline_courserun_metadata + on mitxonline_exam_grades.courserun_readable_id = mitxonline_courserun_metadata.courserun_readable_id left join micromasters_exam_grades on mitxonline_exam_grades.courserun_readable_id = micromasters_exam_grades.examrun_readable_id