From 2f92429a68ec7209059d2d18fe67964c8dd57cf2 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Mon, 9 Mar 2026 06:27:14 -0400 Subject: Simple typing changes, Ruff import formatter. p3 --- .../collections/test_df_collection_thl_web.py | 62 ++++++++++++++-------- 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'tests/incite/collections/test_df_collection_thl_web.py') diff --git a/tests/incite/collections/test_df_collection_thl_web.py b/tests/incite/collections/test_df_collection_thl_web.py index e6f464b..51ca128 100644 --- a/tests/incite/collections/test_df_collection_thl_web.py +++ b/tests/incite/collections/test_df_collection_thl_web.py @@ -1,5 +1,6 @@ from datetime import datetime from itertools import product +from typing import TYPE_CHECKING import dask.dataframe as dd import pandas as pd @@ -8,6 +9,9 @@ from pandera import DataFrameSchema from generalresearch.incite.collections import DFCollection, DFCollectionType +if TYPE_CHECKING: + from generalresearch.incite.base import GRLDatasets + def combo_object(): for x in product( @@ -29,7 +33,7 @@ def combo_object(): ) class TestDFCollection_thl_web: - def test_init(self, df_collection_data_type, offset, df_collection): + def test_init(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection_data_type, DFCollectionType) assert isinstance(df_collection, DFCollection) @@ -39,12 +43,12 @@ class TestDFCollection_thl_web: ) class TestDFCollection_thl_web_Properties: - def test_items(self, df_collection_data_type, offset, df_collection): + def test_items(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection.items, list) for i in df_collection.items: assert i._collection == df_collection - def test__schema(self, df_collection_data_type, offset, df_collection): + def test__schema(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection._schema, DataFrameSchema) @@ -54,16 +58,16 @@ class TestDFCollection_thl_web_Properties: class TestDFCollection_thl_web_BaseProperties: @pytest.mark.skip - def test__interval_range(self, df_collection_data_type, offset, df_collection): + def test__interval_range(self, df_collection_data_type, offset: str, df_collection): pass - def test_interval_start(self, df_collection_data_type, offset, df_collection): + def test_interval_start(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection.interval_start, datetime) - def test_interval_range(self, df_collection_data_type, offset, df_collection): + def test_interval_range(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection.interval_range, list) - def test_progress(self, df_collection_data_type, offset, df_collection): + def test_progress(self, df_collection_data_type, offset: str, df_collection): assert isinstance(df_collection.progress, pd.DataFrame) @@ -78,7 +82,7 @@ class TestDFCollection_thl_web_Methods: @pytest.mark.skip def test_fetch_force_rr_latest( - self, df_collection_data_type, df_collection, offset + self, df_collection_data_type, df_collection, offset: str ): pass @@ -92,55 +96,63 @@ class TestDFCollection_thl_web_Methods: ) class TestDFCollection_thl_web_BaseMethods: - def test_fetch_all_paths(self, df_collection_data_type, offset, df_collection): + def test_fetch_all_paths(self, df_collection_data_type, offset: str, df_collection): res = df_collection.fetch_all_paths( items=None, force_rr_latest=False, include_partial=False ) assert isinstance(res, list) @pytest.mark.skip - def test_ddf(self, df_collection_data_type, offset, df_collection): + def test_ddf(self, df_collection_data_type, offset: str, df_collection): res = df_collection.ddf() assert isinstance(res, dd.DataFrame) # -- cleanup -- @pytest.mark.skip - def test_schedule_cleanup(self, df_collection_data_type, offset, df_collection): + def test_schedule_cleanup( + self, df_collection_data_type, offset: str, df_collection + ): pass @pytest.mark.skip - def test_cleanup(self, df_collection_data_type, offset, df_collection): + def test_cleanup(self, df_collection_data_type, offset: str, df_collection): pass @pytest.mark.skip - def test_cleanup_partials(self, df_collection_data_type, offset, df_collection): + def test_cleanup_partials( + self, df_collection_data_type, offset: str, df_collection + ): pass @pytest.mark.skip - def test_clear_tmp_archives(self, df_collection_data_type, offset, df_collection): + def test_clear_tmp_archives( + self, df_collection_data_type, offset: str, df_collection + ): pass @pytest.mark.skip def test_clear_corrupt_archives( - self, df_collection_data_type, offset, df_collection + self, df_collection_data_type, offset: str, df_collection ): pass @pytest.mark.skip - def test_rebuild_symlinks(self, df_collection_data_type, offset, df_collection): + def test_rebuild_symlinks( + self, df_collection_data_type, offset: str, df_collection + ): pass # -- Source timing -- @pytest.mark.skip - def test_get_item(self, df_collection_data_type, offset, df_collection): + def test_get_item(self, df_collection_data_type, offset: str, df_collection): pass @pytest.mark.skip - def test_get_item_start(self, df_collection_data_type, offset, df_collection): + def test_get_item_start(self, df_collection_data_type, offset: str, df_collection): pass @pytest.mark.skip - def test_get_items(self, df_collection_data_type, offset, df_collection): + def test_get_items(self, df_collection_data_type, offset: str, df_collection): # If we get all the items from the start of the collection, it # should include all the items! res1 = df_collection.items @@ -148,13 +160,19 @@ class TestDFCollection_thl_web_BaseMethods: assert len(res1) == len(res2) @pytest.mark.skip - def test_get_items_from_year(self, df_collection_data_type, offset, df_collection): + def test_get_items_from_year( + self, df_collection_data_type, offset: str, df_collection + ): pass @pytest.mark.skip - def test_get_items_last90(self, df_collection_data_type, offset, df_collection): + def test_get_items_last90( + self, df_collection_data_type, offset: str, df_collection + ): pass @pytest.mark.skip - def test_get_items_last365(self, df_collection_data_type, offset, df_collection): + def test_get_items_last365( + self, df_collection_data_type, offset: str, df_collection + ): pass -- cgit v1.2.3