Example #1
0
def test_unique_rows_eia(pudl_out_eia, live_dbs, unique_subset, df_name):
    """Test whether dataframe has unique records within a subset of columns."""
    if not live_dbs:
        pytest.skip("Data validation only works with a live PUDL DB.")
    pv.check_unique_rows(pudl_out_eia.__getattribute__(df_name)(),
                         subset=unique_subset,
                         df_name=df_name)
Example #2
0
def test_unique_rows_ferc1(pudl_out_ferc1, live_pudl_db, df_name, unique_subset):
    """Test whether dataframe has unique records within a subset of columns."""
    if not live_pudl_db:
        raise AssertionError("Data validation only works with a live PUDL DB.")
    pv.check_unique_rows(
        pudl_out_ferc1.__getattribute__(df_name)(),
        subset=unique_subset, df_name=df_name)
Example #3
0
def test_unique_rows_eia(pudl_out_eia, live_pudl_db, unique_subset, df_name):
    """Test whether dataframe has unique records within a subset of columns."""
    if not live_pudl_db:
        raise AssertionError("Data validation only works with a live PUDL DB.")
    if (pudl_out_eia.freq is None) and (df_name == "gen_eia923"):
        pytest.xfail(reason="RE-RUN ETL DUDE.")
    pv.check_unique_rows(pudl_out_eia.__getattribute__(df_name)(),
                         subset=unique_subset,
                         df_name=df_name)
Example #4
0
def test_unique_rows_mcoe(pudl_out_mcoe, live_pudl_db, unique_subset, df_name):
    """Test whether dataframe has unique records within a subset of columns."""
    if not live_pudl_db:
        raise AssertionError("Data validation only works with a live PUDL DB.")
    if pudl_out_mcoe.freq is None:
        pytest.skip()
    pv.check_unique_rows(
        pudl_out_mcoe.__getattribute__(df_name)(),
        subset=unique_subset, df_name=df_name)