Skip to content
Open
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
2 changes: 1 addition & 1 deletion import-automation/executor/app/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ExecutorConfig:
"gs://unresolved_mcf/scripts/statvar/stat_vars.mcf"
})
# API Environment used by the import tool
use_autopush_dc_api: bool = True
use_autopush_dc_api: bool = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This configuration change (use_autopush_dc_api: bool = False) is unrelated to the PR's objective of migrating compatible imports to use download_util_script.py. Unrelated changes should be kept out of this PR to keep it focused and avoid accidental environment switches.

Suggested change
use_autopush_dc_api: bool = False
use_autopush_dc_api: bool = True
References
  1. Keep pull requests focused and confined to their intended scope. Do not mix unrelated pre-existing issues (such as missing timeout handling) or their corresponding test updates into the current PR; address them in separate PRs instead.

# Invoke import tool genmcf.
invoke_import_tool: bool = True
# Invoke differ tool.
Expand Down
58 changes: 29 additions & 29 deletions scripts/us_bea/states_gdp/manifest.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"import_specifications": [
"import_specifications": [
{
"import_name": "BEA_USStatesQuarterlyGDP",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://www.bea.gov/data/gdp/gdp-state",
"provenance_description": "Quarterly data on inflation-adjusted GDP at a state level in the United States from the US Bureau of Economic Analysis.",
"scripts": [
"../../../util/download_util_script.py --download_url=https://apps.bea.gov/regional/zip/SQGDP.zip --output_folder=input_files --unzip=True",
"preprocess_csv.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_files/preprocessed_data.csv --pv_map=bea_gdp_pv_map.csv --config_file=bea_gdp_metadata.csv --places_resolved_csv=bea_gdp_place_map.csv --existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf --output_path=output_files/BEA_GDP_output"
],
"source_files": [
"input_data/*.csv"
],
Comment on lines +15 to +17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The source_files path should be updated to match the actual downloaded files directory (input_files/) instead of the obsolete input_data/ directory, as the new download script downloads and extracts files to input_files.

Suggested change
"source_files": [
"input_data/*.csv"
],
"source_files": [
"input_files/*.csv"
],

"import_inputs": [
{
"import_name": "BEA_USStatesQuarterlyGDP",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://www.bea.gov/data/gdp/gdp-state",
"provenance_description": "Quarterly data on inflation-adjusted GDP at a state level in the United States from the US Bureau of Economic Analysis.",
"scripts": [
"common_download.py",
"import_data.py",
"import_industry_data_and_gen_mcf.py"
],
"source_files": [
"input_data/*.csv"
],
"import_inputs": [
{
"cleaned_csv": "states_gdp.csv",
"template_mcf": "states_gdp.tmcf",
"node_mcf": "states_gdp_statvars.mcf"
},
{
"cleaned_csv": "states_industry_gdp.csv",
"node_mcf": "states_gdp_industry_statvars.mcf",
"template_mcf": "states_industry_gdp.tmcf"
}
],
"cron_schedule": "30 10 30 1,4,7,10,12 *"
"cleaned_csv": "states_gdp.csv",
"template_mcf": "states_gdp.tmcf",
"node_mcf": "states_gdp_statvars.mcf"
},
{
"cleaned_csv": "states_industry_gdp.csv",
"node_mcf": "states_gdp_industry_statvars.mcf",
"template_mcf": "states_industry_gdp.tmcf"
}
]
],
Comment on lines +18 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

There is a critical mismatch between the stat_var_processor.py output path (output_files/BEA_GDP_output) and the expected files in import_inputs (which still point to the old states_gdp.csv and states_industry_gdp.csv files). Since the new processor generates a single set of output files under output_files/BEA_GDP_output, import_inputs must be updated to point to these new files so the executor can find them.

      "import_inputs": [
        {
          "cleaned_csv": "output_files/BEA_GDP_output.csv",
          "template_mcf": "output_files/BEA_GDP_output.tmcf",
          "node_mcf": "output_files/BEA_GDP_output_stat_vars.mcf"
        }
      ],

"cron_schedule": "30 10 30 1,4,7,10,12 *"
}
]
}
47 changes: 24 additions & 23 deletions statvar_imports/ccd/enrollment/manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"import_specifications": [
"import_specifications": [
{
"import_name": "US_CCD_Enrollment",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://nces.ed.gov/programs/digest/d24/tables/dt24_203.65.asp",
"provenance_description": "Enrollment in public elementary and secondary schools, by level, grade, and race/ethnicity.",
"scripts": [
"../../../util/download_util_script.py --download_url=https://nces.ed.gov/programs/digest/d24/tables/xls/tabn203.65.xlsx --output_folder=source_files",
"preprocess.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_files/*.csv --pv_map=pvmap.csv --config_file=metadata.csv --places_resolved_csv=place_resolver.csv --existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf --output_path=output_files/enrollment_output"
],
"source_files": [
"input_files/ccd_enrollment_input.csv"
],
Comment on lines +15 to +17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The source_files path should be updated to point to the raw downloaded file source_files/tabn203.65.xlsx instead of input_files/ccd_enrollment_input.csv to accurately reflect the download script's output folder and maintain consistency with other manifests.

Suggested change
"source_files": [
"input_files/ccd_enrollment_input.csv"
],
"source_files": [
"source_files/tabn203.65.xlsx"
],

"import_inputs": [
{
"import_name": "US_CCD_Enrollment",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://nces.ed.gov/programs/digest/d24/tables/dt24_203.65.asp",
"provenance_description": "Enrollment in public elementary and secondary schools, by level, grade, and race/ethnicity.",
"scripts": [
"download.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_files/ccd_enrollment_input.csv --pv_map=CCD_Enrollment_pvmap.csv --config_file=CCD_Enrollment_metadata.csv --output_path=output/CCD_Enrollment_output --existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf"
],
"source_files": [
"input_files/ccd_enrollment_input.csv"
],
"import_inputs": [
{
"template_mcf": "output/CCD_Enrollment_output.tmcf",
"cleaned_csv": "output/CCD_Enrollment_output.csv"
}
],
"cron_schedule": "0 06 * * 5"
"template_mcf": "output/CCD_Enrollment_output.tmcf",
"cleaned_csv": "output/CCD_Enrollment_output.csv"
}
]
}
],
Comment on lines +18 to +23

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

There is a critical mismatch between the stat_var_processor.py output path (output_files/enrollment_output) and the expected files in import_inputs (which still point to output/CCD_Enrollment_output.tmcf and output/CCD_Enrollment_output.csv). import_inputs must be updated to point to the new output files under output_files/enrollment_output so the executor can find them.

Suggested change
"import_inputs": [
{
"import_name": "US_CCD_Enrollment",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://nces.ed.gov/programs/digest/d24/tables/dt24_203.65.asp",
"provenance_description": "Enrollment in public elementary and secondary schools, by level, grade, and race/ethnicity.",
"scripts": [
"download.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_files/ccd_enrollment_input.csv --pv_map=CCD_Enrollment_pvmap.csv --config_file=CCD_Enrollment_metadata.csv --output_path=output/CCD_Enrollment_output --existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf"
],
"source_files": [
"input_files/ccd_enrollment_input.csv"
],
"import_inputs": [
{
"template_mcf": "output/CCD_Enrollment_output.tmcf",
"cleaned_csv": "output/CCD_Enrollment_output.csv"
}
],
"cron_schedule": "0 06 * * 5"
"template_mcf": "output/CCD_Enrollment_output.tmcf",
"cleaned_csv": "output/CCD_Enrollment_output.csv"
}
]
}
\ No newline at end of file
],
"import_inputs": [
{
"template_mcf": "output_files/enrollment_output.tmcf",
"cleaned_csv": "output_files/enrollment_output.csv"
}
],

"cron_schedule": "0 06 * * 5"
}
]
}
44 changes: 22 additions & 22 deletions statvar_imports/uae_bayanat/uae_population/manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"import_specifications": [
"import_specifications": [
{
"import_name": "UAE_Population",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://bayanat.ae/api/DatasetResources/DownloadSingle?resourceID=FT1CGOdcLYt6KdUJnFHWwOdTWpeao-LX539QkMLeAKA&fileName=UAE%20Population%20By%20Emirates%20Nationality%20and%20gender",
"provenance_description": "UAE_Population statical data",
"scripts": [
"../../../util/download_util_script.py --download_url=https://bayanat.ae/api/DatasetResources/DownloadSingle?resourceID=FT1CGOdcLYt6KdUJnFHWwOdTWpeao-LX539QkMLeAKA&fileName=UAE%20Population%20By%20Emirates%20Nationality%20and%20gender --output_folder=input",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input/uae_populationbyemiratesnationalityandgender.xlsx --pv_map=uae_population_pvmap.csv --config_file=uae_population_metadata.csv --places_resolved_csv=uae_population_places_resolved_csv.csv --output_path=output/uae_population_output"
],
"source_files": [
"input/uae_populationbyemiratesnationalityandgender.xlsx"
],
"import_inputs": [
{
"import_name": "UAE_Population",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://bayanat.ae/api/DatasetResources/DownloadSingle?resourceID=FT1CGOdcLYt6KdUJnFHWwOdTWpeao-LX539QkMLeAKA&fileName=UAE%20Population%20By%20Emirates%20Nationality%20and%20gender",
"provenance_description": "UAE_Population statical data",
"scripts": [
"uae_download.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input/uae_populationbyemiratesnationalityandgender.xlsx --pv_map=uae_population_pvmap.csv --config_file=uae_population_metadata.csv --places_resolved_csv=uae_population_places_resolved_csv.csv --output_path=output/uae_population_output"
],
"source_files": [
"input/uae_populationbyemiratesnationalityandgender.xlsx"
],
"import_inputs": [
{
"template_mcf": "output/uae_population_output.tmcf",
"cleaned_csv": "output/uae_population_output.csv"
}
],
"cron_schedule": "0 05 * * 1"
"template_mcf": "output/uae_population_output.tmcf",
"cleaned_csv": "output/uae_population_output.csv"
}
]
],
"cron_schedule": "0 05 * * 1"
}
]
}
48 changes: 24 additions & 24 deletions statvar_imports/undata/manifest.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"import_specifications": [
"import_specifications": [
{
"import_name": "UNData",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://data.un.org/Data.aspx?q=city+population&d=POP&f=tableCode%3a240",
"provenance_description": "Population data for countries, capital cities, urban and rural areas not covered by other sources. Outliers were removed from the output",
"scripts": [
"../../util/download_util_script.py --download_url=https://data.un.org/Handlers/DownloadHandler.ashx?DataFilter=tableCode:240&DataMartId=POP&Format=csv&c=2,3,6,8,10,12,14,16,17,18&s=_countryEnglishNameOrderBy:asc,refYear:desc,areaCode:asc --output_folder=input_file --unzip=True",
"../../tools/statvar_importer/stat_var_processor.py --input_data=input_file/*.csv --pv_map=UNData_pvmap.csv --config_file=UNData_metadata.csv --places_resolved_csv=UNData_places_resolved_csv.csv --output_path=output/UNData",
"../../tools/statvar_importer/filter_data_outliers.py --filter_data_input=output/UNData.csv --filter_data_output=output/filter_undata.csv --filter_data_min_value=2 --filter_data_max_yearly_change_ratio=0.5 --filter_data_max_change_ratio=1"
],
"source_files": [
"input_file/*.csv"
],
"import_inputs": [
{
"import_name": "UNData",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://data.un.org/Data.aspx?q=city+population&d=POP&f=tableCode%3a240",
"provenance_description": "Population data for countries, capital cities, urban and rural areas not covered by other sources. Outliers were removed from the output",
"scripts": [
"download.py",
"../../tools/statvar_importer/stat_var_processor.py --input_data=input_file/*.csv --pv_map=UNData_pvmap.csv --config_file=UNData_metadata.csv --places_resolved_csv=UNData_places_resolved_csv.csv --output_path=output/UNData",
"../../tools/statvar_importer/filter_data_outliers.py --filter_data_input=output/UNData.csv --filter_data_output=output/filter_undata.csv --filter_data_min_value=2 --filter_data_max_yearly_change_ratio=0.5 --filter_data_max_change_ratio=1"
],
"source_files": [
"input_file/*.csv"
],
"import_inputs": [
{
"template_mcf": "output/UNData.tmcf",
"cleaned_csv": "output/filter_undata.csv"
}
],
"cron_schedule": "0 05 * * 3"
"template_mcf": "output/UNData.tmcf",
"cleaned_csv": "output/filter_undata.csv"
}
]
}
],
"cron_schedule": "0 05 * * 3"
}
]
}
44 changes: 22 additions & 22 deletions statvar_imports/us_census/us_monthly_retail_sales/manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"import_specifications": [
"import_specifications": [
{
"import_name": "USMonthlyRetailSales",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://www.census.gov/retail/",
"provenance_description": "The Advance Monthly and Monthly Retail Trade Surveys (MARTS and MRTS), the Annual Retail Trade Survey (ARTS), and the Quarterly E-Commerce Report work together to produce the most comprehensive data available on retail economic activity in the United States.",
"scripts": [
"../../../util/download_util_script.py --download_url=https://www.census.gov/retail/mrts/www/mrtssales92-present.xlsx --output_folder=input_file",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_file/mrtssales92-present.xlsx --pv_map=monthly_retail_pvmap.csv --statvar_dcid_remap_csv=monthly_retail_remap.csv --config_file=monthly_retail_metadata.csv --output_path=output/monthly_retail"
],
"import_inputs": [
{
"import_name": "USMonthlyRetailSales",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://www.census.gov/retail/",
"provenance_description": "The Advance Monthly and Monthly Retail Trade Surveys (MARTS and MRTS), the Annual Retail Trade Survey (ARTS), and the Quarterly E-Commerce Report work together to produce the most comprehensive data available on retail economic activity in the United States.",
"scripts": [
"download.py",
"../../../tools/statvar_importer/stat_var_processor.py --input_data=input_file/monthly_retail.xlsx --pv_map=monthly_retail_pvmap.csv --statvar_dcid_remap_csv=monthly_retail_remap.csv --config_file=monthly_retail_metadata.csv --output_path=output/monthly_retail"
],
"import_inputs": [
{
"template_mcf": "output/monthly_retail.tmcf",
"cleaned_csv": "output/monthly_retail.csv"
}
],
"source_files": [
"input_file/monthly_retail.xlsx"
],
"cron_schedule": "30 05 * * 1"
"template_mcf": "output/monthly_retail.tmcf",
"cleaned_csv": "output/monthly_retail.csv"
}
]
],
"source_files": [
"input_file/mrtssales92-present.xlsx"
],
"cron_schedule": "30 05 * * 1"
}
]
}
Loading