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

Merge dev into main for 2023-11-09 #3031

Merged
merged 63 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
6cd7712
First pass of integrating the monthly EIA923 data into the rest of th…
aesharpe Oct 12, 2023
681b72d
remove breakpoint
aesharpe Oct 12, 2023
5899fc0
Merge branch 'dev' into add-data-maturity-for-923m
aesharpe Oct 12, 2023
2bff97d
Add function to drop ytd records for annual tables
aesharpe Oct 12, 2023
796b5da
Adjust monthly row expectations for gf and frc tables after dropping …
aesharpe Oct 12, 2023
77e052e
Tweak the way we add data maturity to the eia923 monthly files and re…
aesharpe Oct 16, 2023
44b4d44
Merge branch 'dev' into add-data-maturity-for-923m
aesharpe Oct 17, 2023
63dee8e
Merge with dev
aesharpe Oct 24, 2023
b50ea1d
Litle updates:
aesharpe Oct 25, 2023
572147c
For now, comment out the checks that make sure we have the same years…
aesharpe Oct 25, 2023
aa42b28
Update min max rows
aesharpe Oct 25, 2023
a588420
Add data_maturity field to harvested EIA tables so that we can drop y…
aesharpe Oct 25, 2023
1d267ab
Address PR comments:
aesharpe Oct 27, 2023
8ccc44c
Merge branch 'dev' into add-data-maturity-for-923m
aesharpe Oct 27, 2023
b3c11c2
Fix release note trailing whitespace error
aesharpe Oct 30, 2023
3b35892
Update test_eia923_dependency function to make sure some 860 and 923 …
aesharpe Oct 30, 2023
47304b3
Only generate alphanumeric entity IDs in test - non-printable charact…
jdangerx Oct 31, 2023
dfea5ef
Set up Cloud SQL postgres database for dagster storage
bendnorman Oct 31, 2023
05901ab
Copy dagster.yaml after DAGSTER_HOME is created
bendnorman Oct 31, 2023
02c52f6
Add proper quoting rules to DAGSTER_PG_PASSWORD secret
bendnorman Oct 31, 2023
dcfb8de
Use max cpus for nightly builds and spin dagster-storage SQL instance…
bendnorman Nov 1, 2023
ad8442d
Create and delete Cloud SQL db during nightly builds
bendnorman Nov 1, 2023
ab9425a
Set PUDL_SETTINGS_YML to etl_full.yml and add git sha to Cloud SQL da…
bendnorman Nov 1, 2023
6592fad
Add short github ref to database name
bendnorman Nov 1, 2023
2f85315
Update DAGSTER_PG_DB with short git sha
bendnorman Nov 1, 2023
8c60657
Update date range for nightly build links to include 2022
zaneselvans Nov 1, 2023
24f6b8d
Update 923 settings files to accomodate 2023 data and update settings…
aesharpe Nov 1, 2023
45f2d02
Fix calculating the report_date in demand_hourly_pa_ferc714
rousik Nov 1, 2023
bf77d1a
Require non-null report_date in FERC 714 hourly demand table.
zaneselvans Nov 1, 2023
b376141
Update date validation function to only look at instances where data_…
aesharpe Nov 1, 2023
dbf686f
Merge pull request #2936 from catalyst-cooperative/add-data-maturity-…
aesharpe Nov 1, 2023
e848d64
Fix calculating the report_date in demand_hourly_pa_ferc714
rousik Nov 1, 2023
1c6dd24
Merge branch 'dev' into setup-dagster-postgres
bendnorman Nov 1, 2023
5b33500
Remove Cloud SQL lifecycle management from gcp_pudl_etl.sh script
bendnorman Nov 1, 2023
c15e063
Merge branch 'dev' into setup-dagster-postgres
bendnorman Nov 2, 2023
633b63d
Update data contributors, add zenodo role and doi field, update US co…
e-belfer Nov 2, 2023
4b028d2
Update to ZenodoDoi class, update to https
e-belfer Nov 2, 2023
6e6bf5e
Remove leftover string
e-belfer Nov 2, 2023
e7aedda
Merge pull request #3004 from catalyst-cooperative/datapackage-update
e-belfer Nov 2, 2023
c11b1a4
Switch regex strategy to sampling strategy to improve performance (#2…
jdangerx Nov 2, 2023
a79edeb
add alembic schema changes for the recent constraint.
rousik Nov 2, 2023
0fa0c85
Merge pull request #3012 from catalyst-cooperative/fix-alembic-schema
rousik Nov 2, 2023
18bb60f
Merge pull request #2996 from catalyst-cooperative/setup-dagster-post…
bendnorman Nov 3, 2023
ef20339
only fix a reporting_frequency_code when the column exists
cmgosnell Nov 3, 2023
2848e01
Update responses requirement from <0.24,>=0.14 to >=0.14,<0.25
dependabot[bot] Nov 6, 2023
51ed7e5
Update pyarrow requirement from <14,>=13 to >=13,<15
dependabot[bot] Nov 6, 2023
c2e7889
Update dagster-postgres requirement
dependabot[bot] Nov 6, 2023
1ed333c
Merge pull request #3015 from catalyst-cooperative/dependabot/pip/dev…
zaneselvans Nov 6, 2023
039116a
Merge pull request #3016 from catalyst-cooperative/dependabot/pip/dev…
zaneselvans Nov 6, 2023
71ee2bd
Merge pull request #3017 from catalyst-cooperative/dependabot/pip/dev…
zaneselvans Nov 6, 2023
aea60b9
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Nov 6, 2023
acbf788
update tox and eia923 rows
cmgosnell Nov 6, 2023
51be942
Merge pull request #3019 from catalyst-cooperative/pre-commit-ci-upda…
zaneselvans Nov 6, 2023
5a96335
Merge branch 'dev' into fix-reporting_frequency_code
zaneselvans Nov 6, 2023
f251def
Merge pull request #3013 from catalyst-cooperative/fix-reporting_freq…
zaneselvans Nov 7, 2023
e4c1c46
update excepted rows for no-fips id-ed respondents but keep annualize…
cmgosnell Nov 7, 2023
1e2857f
add report year validation test
cmgosnell Nov 7, 2023
f25e921
add minmax rows into validation test for chonky table
cmgosnell Nov 7, 2023
fcf4ccc
Merge pull request #3023 from catalyst-cooperative/ferc714_mystery_da…
cmgosnell Nov 7, 2023
095d31b
idk exactly why the "nan"s began existing but this fixes it
cmgosnell Nov 7, 2023
14e6bc8
revert the replace of "nan" by stopping introducing them! plus some l…
cmgosnell Nov 7, 2023
b7533cf
REALLY REALLY its a nullable string
cmgosnell Nov 8, 2023
a2bdffa
Merge pull request #3025 from catalyst-cooperative/fix_mystery_fuel_c…
cmgosnell Nov 8, 2023
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
7 changes: 7 additions & 0 deletions .github/workflows/build-deploy-pudl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:

# Deploy PUDL image to GCE
- name: Deploy
env:
DAGSTER_PG_PASSWORD: ${{ secrets.DAGSTER_PG_PASSWORD }}
run: |-
gcloud compute instances add-metadata "$GCE_INSTANCE" \
--zone "$GCE_INSTANCE_ZONE" \
Expand All @@ -110,6 +112,11 @@ jobs:
--container-env AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--container-env AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
--container-env AWS_DEFAULT_REGION=${{ secrets.AWS_DEFAULT_REGION }} \
--container-env DAGSTER_PG_USERNAME="postgres" \
--container-env DAGSTER_PG_PASSWORD="$DAGSTER_PG_PASSWORD" \
--container-env DAGSTER_PG_HOST="104.154.182.24" \
--container-env DAGSTER_PG_DB="dagster-storage" \
--container-env PUDL_SETTINGS_YML="/home/catalyst/src/pudl/package_data/settings/etl_full.yml" \

# Start the VM
- name: Start the deploy-pudl-vm
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
# Formatters: hooks that re-write Python & documentation files
####################################################################################
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.1.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ ENV DAGSTER_HOME=${CONTAINER_PUDL_WORKSPACE}/dagster_home
# Create data input/output directories
RUN mkdir -p ${PUDL_INPUT} ${PUDL_OUTPUT} ${DAGSTER_HOME}

# Copy dagster configuration file
COPY docker/dagster.yaml ${DAGSTER_HOME}/dagster.yaml

# Create a conda environment based on the specification in the repo
COPY test/test-environment.yml test/test-environment.yml
RUN mamba create --copy --prefix ${CONDA_PREFIX} --yes python=${PYTHON_VERSION} && \
Expand Down
12 changes: 12 additions & 0 deletions docker/dagster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
storage:
postgres:
postgres_db:
username:
env: DAGSTER_PG_USERNAME
password:
env: DAGSTER_PG_PASSWORD
hostname:
env: DAGSTER_PG_HOST
db_name:
env: DAGSTER_PG_DB
port: 5432
1 change: 0 additions & 1 deletion docker/gcp_pudl_etl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function run_pudl_etl() {
$PUDL_SETTINGS_YML \
&& pudl_etl \
--loglevel DEBUG \
--max-concurrent 6 \
--gcs-cache-path gs://internal-zenodo-cache.catalyst.coop \
$PUDL_SETTINGS_YML \
&& pytest \
Expand Down
20 changes: 10 additions & 10 deletions docs/data_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,42 +83,42 @@ AWS CLI, or programmatically via the S3 API. They can also be downloaded directl
HTTPS using the following links:

* `PUDL SQLite DB <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/pudl.sqlite>`__
* `EPA CEMS Hourly Emissions Parquet (1995-2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/hourly_emissions_epacems.parquet>`__
* `EPA CEMS Hourly Emissions Parquet (1995-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/hourly_emissions_epacems.parquet>`__
* `Census DP1 SQLite DB (2010) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/censusdp1tract.sqlite>`__

* Raw FERC Form 1:

* `FERC-1 SQLite derived from DBF (1994-2020) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1.sqlite>`__
* `FERC-1 SQLite derived from XBRL (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1_xbrl.sqlite>`__
* `FERC-1 SQLite derived from XBRL (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1_xbrl.sqlite>`__
* `FERC-1 Datapackage (JSON) describing SQLite derived from XBRL <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1_xbrl_datapackage.json>`__
* `FERC-1 XBRL Taxonomy Metadata as JSON (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1_xbrl_taxonomy_metadata.json>`__
* `FERC-1 XBRL Taxonomy Metadata as JSON (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc1_xbrl_taxonomy_metadata.json>`__

* Raw FERC Form 2:

* `FERC-2 SQLite derived from DBF (1996-2020) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2.sqlite>`__
* `FERC-2 SQLite derived from XBRL (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2_xbrl.sqlite>`__
* `FERC-2 SQLite derived from XBRL (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2_xbrl.sqlite>`__
* `FERC-2 Datapackage (JSON) describing SQLite derived from XBRL <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2_xbrl_datapackage.json>`__
* `FERC-2 XBRL Taxonomy Metadata as JSON (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2_xbrl_taxonomy_metadata.json>`__
* `FERC-2 XBRL Taxonomy Metadata as JSON (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc2_xbrl_taxonomy_metadata.json>`__

* Raw FERC Form 6:

* `FERC-6 SQLite derived from DBF (2000-2020) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6.sqlite>`__
* `FERC-6 SQLite derived from XBRL (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6_xbrl.sqlite>`__
* `FERC-6 SQLite derived from XBRL (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6_xbrl.sqlite>`__
* `FERC-6 Datapackage (JSON) describing SQLite derived from XBRL <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6_xbrl_datapackage.json>`__
* `FERC-6 XBRL Taxonomy Metadata as JSON (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6_xbrl_taxonomy_metadata.json>`__
* `FERC-6 XBRL Taxonomy Metadata as JSON (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc6_xbrl_taxonomy_metadata.json>`__

* Raw FERC Form 60:

* `FERC-60 SQLite derived from DBF (2006-2020) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc60.sqlite>`__
* `FERC-60 SQLite derived from XBRL (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc60_xbrl.sqlite>`__
* `FERC-60 SQLite derived from XBRL (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc60_xbrl.sqlite>`__
* `FERC-60 Datapackage (JSON) describing SQLite derived from XBRL <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc60_xbrl_datapackage.json>`__
* `FERC-60 XBRL Taxonomy Metadata as JSON (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc60_xbrl_taxonomy_metadata.json>`__

* Raw FERC Form 714:

* `FERC-714 SQLite derived from XBRL (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc714_xbrl.sqlite>`__
* `FERC-714 SQLite derived from XBRL (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc714_xbrl.sqlite>`__
* `FERC-714 Datapackage (JSON) describing SQLite derived from XBRL <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc714_xbrl_datapackage.json>`__
* `FERC-714 XBRL Taxonomy Metadata as JSON (2021) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc714_xbrl_taxonomy_metadata.json>`__
* `FERC-714 XBRL Taxonomy Metadata as JSON (2021-2022) <https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/dev/ferc714_xbrl_taxonomy_metadata.json>`__


.. _access-zenodo:
Expand Down
3 changes: 2 additions & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Data Coverage
^^^^^^^^^^^^^

* Updated :doc:`data_sources/eia860` to include early release data from 2022.
* Updated :doc:`data_sources/eia923` to include early release data from 2022.
* Updated :doc:`data_sources/eia923` to include early release data from 2022 and
monthly YTD data as of April 2023.
* Updated :doc:`data_sources/epacems` to switch from the old FTP server to the new
CAMPD API, and to include 2022 data. Due to changes in the ETL, Alaska, Puerto Rico
and Hawaii are now included in CEMS processing. See issue :issue:`1264` & PRs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
"""add data_maturity to eia923m tables

Revision ID: 1ceb9897fd34
Revises: f11241c9292d
Create Date: 2023-10-26 16:30:33.771381

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '1ceb9897fd34'
down_revision = 'f11241c9292d'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('boiler_fuel_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_boiler_fuel_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_boiler_fuel_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_boiler_fuel_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_boiler_fuel_monthly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_boiler_fuel_monthly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_boiler_fuel_yearly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_boiler_fuel_yearly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_fuel_receipts_costs_monthly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_fuel_receipts_costs_yearly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_generation_fuel_combined_monthly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_generation_fuel_combined_monthly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_generation_fuel_combined_yearly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_generation_fuel_combined_yearly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_generation_monthly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_generation_monthly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_generation_yearly_eia923', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_generation_yearly_eia923_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

with op.batch_alter_table('denorm_plants_utilities_eia', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'))
batch_op.create_foreign_key(batch_op.f('fk_denorm_plants_utilities_eia_data_maturity_data_maturities'), 'data_maturities', ['data_maturity'], ['code'])

# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('denorm_plants_utilities_eia', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_plants_utilities_eia_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_generation_yearly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_generation_yearly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_generation_monthly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_generation_monthly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_generation_fuel_combined_yearly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_generation_fuel_combined_yearly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_generation_fuel_combined_monthly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_generation_fuel_combined_monthly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_fuel_receipts_costs_yearly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_fuel_receipts_costs_monthly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_boiler_fuel_yearly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_boiler_fuel_yearly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_boiler_fuel_monthly_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_boiler_fuel_monthly_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('denorm_boiler_fuel_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_denorm_boiler_fuel_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

with op.batch_alter_table('boiler_fuel_eia923', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('fk_boiler_fuel_eia923_data_maturity_data_maturities'), type_='foreignkey')
batch_op.drop_column('data_maturity')

# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""demand_hourly_pa_ferc714.report_date can't be null

Revision ID: 3313ca078f4e
Revises: 1ceb9897fd34
Create Date: 2023-11-02 15:48:50.477585

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '3313ca078f4e'
down_revision = '1ceb9897fd34'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('demand_hourly_pa_ferc714', schema=None) as batch_op:
batch_op.alter_column('report_date',
existing_type=sa.DATE(),
nullable=False)

# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('demand_hourly_pa_ferc714', schema=None) as batch_op:
batch_op.alter_column('report_date',
existing_type=sa.DATE(),
nullable=True)

# ### end Alembic commands ###
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
"coloredlogs>=14.0,<15.1", # Dagster requires 14.0
"dagster-webserver>=1.4,<1.6",
"dagster>=1.4,<1.6",
"dagster-postgres>=0.21.5,<0.21.7",
"dask>=2022.5,<2023.10.2",
"datapackage>=1.11,<1.16", # Transition datastore to use frictionless.
"email-validator>=1.0.3", # pydantic[email]
Expand All @@ -41,7 +42,7 @@ dependencies = [
"openpyxl>=3.0.10", # pandas[excel]
"pandas[parquet,excel,fss,gcp,compression]>=2,<2.2",
"pandera>=0.17,<1.0",
"pyarrow>=13,<14", # pandas[parquet]
"pyarrow>=13,<15", # pandas[parquet]
"pydantic>=1.7,<2",
"python-dotenv>=1,<1.1",
"pyxlsb>=1.0.9", # pandas[excel]
Expand Down Expand Up @@ -149,7 +150,7 @@ test = [
"pytest-cov>=4,<4.2",
"pytest-mock>=3,<3.13",
"pytest>=7,<7.5",
"responses>=0.14,<0.24",
"responses>=0.14,<0.25",
"ruff>=0.1,<0.2",
"tox>=4,<4.12",
]
Expand Down
3 changes: 2 additions & 1 deletion src/pudl/analysis/allocate_gen_fuel.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ def allocate_gen_fuel_by_generator_energy_source(
# Add any startup energy source codes to the list of energy source codes
gens_at_freq = adjust_msw_energy_source_codes(gens_at_freq, gf, bf)
gens_at_freq = add_missing_energy_source_codes_to_gens(gens_at_freq, gf, bf)
# do the association!
# do the association! --> this step is where a small no. of plants are dropped for
# an unknown reason. Investigate in issue #2978.
gen_assoc = associate_generator_tables(
gens=gens_at_freq, gf=gf, gen=gen, bf=bf, bga=bga
)
Expand Down
Loading