Skip to content

Commit

Permalink
Add generator_operating_date to 860M changelog table (#3751)
Browse files Browse the repository at this point in the history
* Add generator_operating_date to 860M changelog table

* Update release notes
  • Loading branch information
e-belfer authored Jul 29, 2024
1 parent ad0ed69 commit d220ee5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ Data Cleaning
* When ``generator_operating_date`` values are too inconsistent to be harvested
successfully, we now take the last reported date in EIA 860 and 860M. See :issue:`423`
and PR :pr:`3967`.
* Added the ``generator_operating_date`` field into
:ref:`core_eia860m__changelog_generators`, adding 860M reported generator operating
dates into the changelog table. This table is not harvested, and thus does not affect
the ``generator_operating_date`` values reported in other core EIA tables. See
:issue:`3722` and PR :pr:`3751.`

Bug Fixes
^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Add generator_operating_date to 860 changelog table
Revision ID: 52aa9f44b6a7
Revises: 49d2f4f7d7b7
Create Date: 2024-07-29 18:15:06.462350
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '52aa9f44b6a7'
down_revision = '49d2f4f7d7b7'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('core_eia860m__changelog_generators', schema=None) as batch_op:
batch_op.add_column(sa.Column('generator_operating_date', sa.Date(), nullable=True, comment='Date the generator began commercial operation. If harvested values are inconsistent, we default to using the most recently reported date.'))

# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('core_eia860m__changelog_generators', schema=None) as batch_op:
batch_op.drop_column('generator_operating_date')

# ### end Alembic commands ###
1 change: 1 addition & 0 deletions src/pudl/metadata/resources/eia860m.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"energy_source_code_1",
"energy_storage_capacity_mwh",
"fuel_type_code_pudl",
"generator_operating_date",
"generator_retirement_date",
"latitude",
"longitude",
Expand Down

0 comments on commit d220ee5

Please sign in to comment.