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

Make the reconstructable job not take any arguments at all. #3996

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/pudl/etl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@


def pudl_etl_job_factory(
logfile: str | None = None, loglevel: str = "INFO", process_epacems: bool = True
logfile: str | None = None,
loglevel: str = "INFO",
process_epacems: bool = True,
base_job: str = "etl_full",
) -> Callable[[], JobDefinition]:
"""Factory for parameterizing a reconstructable pudl_etl job.

Expand All @@ -36,11 +39,11 @@ def pudl_etl_job_factory(
The job definition to be executed.
"""

def get_pudl_etl_job(job_name: str | None = None):
def get_pudl_etl_job():
"""Create an pudl_etl_job wrapped by to be wrapped by reconstructable."""
pudl.logging_helpers.configure_root_logger(logfile=logfile, loglevel=loglevel)
if job_name is None:
job_name = "etl_full_no_cems" if not process_epacems else "etl_full"
cems_suffix = "" if process_epacems else "_no_cems"
job_name = f"{base_job}{cems_suffix}"
return defs.get_job_def(job_name)

return get_pudl_etl_job
Expand Down
2 changes: 2 additions & 0 deletions src/pudl/transform/vcerare.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ def check_rows(context: AssetCheckExecutionContext) -> AssetCheckResult:
logger.info("Check VCE RARE hourly table is the expected length")

# Define row counts for fast/full etl
# TODO 2024-12-27: make this check row counts per year instead of having
Copy link
Member

Choose a reason for hiding this comment

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

Agree, but we'll probably eventually wind up with distribution tests that do want fast vs. full specified and can't be parameterized by year, so the solution will probably come in handy anyways?

# two different counts based on job name - less brittle.
row_counts = {
"etl_full": 136437000,
"etl_fast": 27287400,
Expand Down
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def pudl_io_manager(
md = PUDL_PACKAGE.to_sql()
md.create_all(engine)
# Run the ETL and generate a new PUDL SQLite DB for testing:
execute_result = pudl_etl_job_factory()("etl_fast").execute_in_process(
execute_result = pudl_etl_job_factory(base_job="etl_fast")().execute_in_process(
run_config={
"resources": {
"dataset_settings": {
Expand Down
Loading