repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
ing-bank/popmon
from copy import deepcopy from pathlib import Path import pandas as pd import pytest from popmon.hist.filling import make_histograms from popmon.pipeline.metrics import df_stability_metrics def spark_context(): if not spark_found: return None current_path = Path(__file__).parent scala = "2.12" ...
(v1, v2)
assert
collection
tests/popmon/spark/test_spark.py
test_spark_make_histograms
124
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_compute_traffic_light_bounds(): datastore = {"test_data": pytest.test_comparer_df} conf = { "monitoring_rules": { "the_feature:mae": [8, 4, 2, 2], "dummy_feature:*": [0, 0, 0, 0], ...
[8, 4, 2, 2]
assert
collection
tests/popmon/alerting/test_compute_tl_bounds.py
test_compute_traffic_light_bounds
39
null
ing-bank/popmon
import numpy as np import pytest from popmon.hist.filling import get_bin_specs, make_histograms from popmon.stitching import stitch_histograms def test_histogram_stitching(): features1 = sorted(["date:isActive", "date:eyeColor", "date:latitude"]) features2 = sorted(["isActive", "eyeColor", "latitude", "age"])...
800
assert
numeric_literal
tests/popmon/stitching/test_histogram_stitching.py
test_histogram_stitching
21
null
ing-bank/popmon
from datetime import datetime, timedelta from pathlib import Path import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def spark_context(): if not spark_found: return None current_path = Path(__file__).parent scala = "2.12" if int(pyspark_version[0]) == 3...
ValueError)
pytest.raises
variable
tests/popmon/spark/test_split_dataset_spark.py
test_split_dataset_spark_int_underflow
74
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
2
assert
numeric_literal
tests/popmon/analysis/test_hist_numpy.py
test_histogram
85
null
ing-bank/popmon
import pandas as pd import pytest from popmon.alerting import AlertsSummary, ComputeTLBounds, traffic_light_summary from popmon.analysis.apply_func import ApplyFunc from popmon.base import Pipeline def test_integration_alerting(): datastore = {"test_data": pytest.test_comparer_df} conf = { "monitorin...
4
assert
numeric_literal
tests/popmon/alerting/test_integration.py
test_integration_alerting
49
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
entries0)
assert_*
variable
tests/popmon/analysis/test_hist_numpy.py
test_get_consistent_numpy_entries
337
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon import resources from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.comparison.hist_comparer import ( ExpandingHistComparer, ReferenceHistComparer, RollingHistComparer, hist_compare, ) from popmon.analysis.functions imp...
16
assert
numeric_literal
tests/popmon/analysis/comparison/test_hist_comparer.py
test_reference_hist_comparer
117
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.comparison.hist_comparer import ReferenceHistComparer from popmon.base import Pipeline from popmon.config import Settings from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader from popmon.visualization imp...
len(features)
assert
func_call
tests/popmon/visualization/test_report_generator.py
test_report_generator
52
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon import resources from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.comparison import ( ExpandingNormHistComparer, ReferenceNormHistComparer, RollingNormHistComparer, ) from popmon.analysis.functions import ( expand, ...
3.217532467532462)
assert_*
numeric_literal
tests/popmon/analysis/test_functions.py
test_chi_squared2
613
null
ing-bank/popmon
import numpy as np from popmon.analysis.profiling.profiles import profile_fraction_of_true def test_fraction_of_true(): res = profile_fraction_of_true([], []) assert np.isnan(res) res = profile_fraction_of_true(["a"], [10]) assert np.isnan(res) res = profile_fraction_of_true(["a", "b", "c"], [10, ...
1.0
assert
numeric_literal
tests/popmon/analysis/profiling/test_profiles.py
test_fraction_of_true
22
null
ing-bank/popmon
from datetime import datetime, timedelta from pathlib import Path import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def spark_context(): if not spark_found: return None current_path = Path(__file__).parent scala = "2.12" if int(pyspark_version[0]) == 3...
51
assert
numeric_literal
tests/popmon/spark/test_split_dataset_spark.py
test_split_dataset_spark_condition
172
null
ing-bank/popmon
import numpy as np import pytest from popmon.base import Module def test_popmon_module(test_module): datastore = {"x": np.arange(10)} datastore = test_module.transform(datastore) assert "x" in datastore # check if key 'x' is still in the datastore np.testing.assert_almost_equal(np.mean(datastore["sc...
0.3)
assert_*
numeric_literal
tests/popmon/base/test_module.py
test_popmon_module
37
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_condition(test_dataframe_pandas): reference, df = split_dataset( test_dataframe_pandas, split=test_dataframe_pandas.date < da...
949
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_condition
99
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
test_data
assert
variable
tests/popmon/alerting/test_apply_tl_bounds.py
test_apply_monitoring_business_rules
64
null
ing-bank/popmon
import copy import json import pandas as pd import pytest from popmon.io import FileWriter DATA = {"name": ["Name"], "surname": ["Surname"]} def get_ready_ds(): return copy.deepcopy({"my_data": DATA}) def to_json(data, **kwargs): return json.dumps(data, **kwargs) def to_pandas(data): return pd.DataFra...
TypeError)
pytest.raises
variable
tests/popmon/io/test_file_writer.py
test_file_writer_not_a_func
38
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
-0.5)
assert_*
numeric_literal
tests/popmon/alerting/test_apply_tl_bounds.py
test_apply_dynamic_traffic_light_bounds
131
null
ing-bank/popmon
import itertools import numpy as np from scipy import linalg, stats from popmon.stats.numpy import ( mean, probability_distribution_mean_covariance, quantile, std, ) def get_data(): rng = np.random.default_rng(5) a = rng.integers(0, 10, size=(3, 4, 5, 6)) w = rng.integers(0, 10, size=(3, ...
quantile(a, 0.1, w, axis=(1, 2), keepdims=False))
assert_*
func_call
tests/popmon/stats/test_numpy.py
test_statistics_1
184
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
ValueError)
pytest.raises
variable
tests/popmon/analysis/test_hist_numpy.py
test_get_consistent_numpy_2dgrids
213
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_int(test_dataframe_pandas): reference, df = split_dataset(test_dataframe_pandas, split=3, time_axis="date") assert reference.shape[0] == 3 ...
997
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_int
26
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.comparison.hist_comparer import ReferenceHistComparer from popmon.base import Pipeline from popmon.config import Settings from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader from popmon.visualization imp...
datastore["comparison"]
assert
complex_expr
tests/popmon/visualization/test_report_generator.py
test_report_generator
54
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.hist_numpy import assert_similar_hists, check_similar_hists from popmon.base import Pipeline from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader def test_hist_splitter(): hist_list = [ "date...
datastore["output_hist"]
assert
complex_expr
tests/popmon/hist/test_hist_splitter.py
test_hist_splitter
43
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
centers)
assert_*
variable
tests/popmon/analysis/test_hist_numpy.py
test_get_consistent_numpy_entries
343
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd from conftest import make_mixed_dataframe from popmon.hist.hist_utils import ( is_numeric, is_timestamp, project_on_x, project_split2dhist_on_axis, sparse_bin_centers_x, split_hist_along_first_dimension, sum_entries, sum_o...
splitC2
assert
variable
tests/popmon/hist/test_histogram.py
test_project_split2dhist_on_axis
325
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_float_round(test_dataframe_pandas): reference, df = split_dataset(test_dataframe_pandas, split=0.8888, time_axis="date") assert reference.shape[...
112
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_float_round
61
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd from popmon.analysis.profiling.hist_profiler import HistProfiler from popmon.hist.hist_utils import get_bin_centers def test_profile_hist1d(): num_bins = 1000 num_entries = 10000 hist_name = "histogram" split_len = 10 split = [] ...
profiles[0]
assert
complex_expr
tests/popmon/analysis/profiling/test_hist_profiler.py
test_profile_hist1d
31
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_collect_traffic_light_bounds(): test_dict = {"a": 2, "b:c": 5, "b:d": 6, "x:y:z": 17} pkeys, nkeys = collect_traffic_light_bounds(test_dict) assert nkeys ==
["a"]
assert
collection
tests/popmon/alerting/test_compute_tl_bounds.py
test_collect_traffic_light_bounds
11
null
ing-bank/popmon
import pandas as pd from popmon.analysis.merge_statistics import MergeStatistics def test_merge_statistics(): df1 = pd.DataFrame( { "A": ["A0", "A1", "A2", "A3"], "B": ["B0", "B1", "B2", "B3"], "C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"], ...
df2)
assert_*
variable
tests/popmon/analysis/test_merge_statistics.py
test_merge_statistics
47
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.base import Pipeline from popmon.config import Settings from popmon.io import JsonReader from popmon.pipeline.metrics import df_stability_metrics, stability_metrics def test_hists_stability_metrics(): settings = Settings(reference_type="ro...
list(ds.keys())
assert
func_call
tests/popmon/pipeline/test_metrics.py
test_hists_stability_metrics
38
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_compute_traffic_light_bounds(): datastore = {"test_data": pytest.test_comparer_df} conf = { "monitoring_rules": { "the_feature:mae": [8, 4, 2, 2], "dummy_feature:*": [0, 0, 0, 0], ...
output.keys()
assert
func_call
tests/popmon/alerting/test_compute_tl_bounds.py
test_compute_traffic_light_bounds
38
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_compute_traffic_light_funcs(): datastore = {"test_data": pytest.test_comparer_df} conf = { "monitoring_rules": { "the_feature:mae": [8, 4, 2, 2], "dummy_feature:*": [0, 0, 0, 0], ...
["mse"]
assert
collection
tests/popmon/alerting/test_compute_tl_bounds.py
test_compute_traffic_light_funcs
74
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_int_underflow(test_dataframe_pandas): with pytest.raises(
ValueError)
pytest.raises
variable
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_int_underflow
32
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
-2.0)
assert_*
numeric_literal
tests/popmon/alerting/test_apply_tl_bounds.py
test_apply_dynamic_traffic_light_bounds
132
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.hist_numpy import assert_similar_hists, check_similar_hists from popmon.base import Pipeline from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader def test_hist_splitter(): hist_list = [ "date...
len(features)
assert
func_call
tests/popmon/hist/test_hist_splitter.py
test_hist_splitter
41
null
ing-bank/popmon
import copy import json import pandas as pd import pytest from popmon.io import FileWriter DATA = {"name": ["Name"], "surname": ["Surname"]} def get_ready_ds(): return copy.deepcopy({"my_data": DATA}) def to_json(data, **kwargs): return json.dumps(data, **kwargs) def to_pandas(data): return pd.DataFra...
DATA
assert
variable
tests/popmon/io/test_file_writer.py
test_file_writer_df
47
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.hist_numpy import assert_similar_hists, check_similar_hists from popmon.base import Pipeline from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader @pytest.mark.filterwarnings("ignore:Input histograms have...
False
assert
bool_literal
tests/popmon/hist/test_hist_splitter.py
test_hist_splitter_filter
94
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.analysis.apply_func import ApplyFunc, apply_func, apply_func_array from popmon.analysis.functions import pull from popmon.analysis.profiling.pull_calculator import ( ExpandingPullCalculator, ReferencePullCalculator, RefMedianMadPullCalculator...
-0.6745)
assert_*
numeric_literal
tests/popmon/analysis/profiling/test_apply_func.py
test_median_mad_pull_comparer
138
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
datastore
assert
variable
tests/popmon/alerting/test_apply_tl_bounds.py
test_apply_monitoring_business_rules
61
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_condition(test_dataframe_pandas): reference, df = split_dataset( test_dataframe_pandas, split=test_dataframe_pandas.date < da...
51
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_condition
98
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.analysis.apply_func import ApplyFunc, apply_func, apply_func_array from popmon.analysis.functions import pull from popmon.analysis.profiling.pull_calculator import ( ExpandingPullCalculator, ReferencePullCalculator, RefMedianMadPullCalculator...
6)
assert_*
numeric_literal
tests/popmon/analysis/profiling/test_apply_func.py
test_variance_comparer
99
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_float_round(test_dataframe_pandas): reference, df = split_dataset(test_dataframe_pandas, split=0.8888, time_axis="date") assert reference.shape...
888
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_float_round
60
null
ing-bank/popmon
from datetime import datetime, timedelta import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def test_split_dataset_pandas_int(test_dataframe_pandas): reference, df = split_dataset(test_dataframe_pandas, split=3, time_axis="date") assert reference.shape[0] ==
3
assert
numeric_literal
tests/popmon/pipeline/test_split_dataset.py
test_split_dataset_pandas_int
25
null
ing-bank/popmon
from datetime import datetime, timedelta from pathlib import Path import pandas as pd import pytest from popmon.pipeline.dataset_splitter import split_dataset def spark_context(): if not spark_found: return None current_path = Path(__file__).parent scala = "2.12" if int(pyspark_version[0]) == 3...
888
assert
numeric_literal
tests/popmon/spark/test_split_dataset_spark.py
test_split_dataset_spark_float_round
117
null
ing-bank/popmon
import numpy as np import pytest from popmon.hist.filling import get_bin_specs, make_histograms from popmon.stitching import stitch_histograms def test_histogram_stitching(): features1 = sorted(["date:isActive", "date:eyeColor", "date:latitude"]) features2 = sorted(["isActive", "eyeColor", "latitude", "age"])...
400
assert
numeric_literal
tests/popmon/stitching/test_histogram_stitching.py
test_histogram_stitching
22
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_collect_traffic_light_bounds(): test_dict = {"a": 2, "b:c": 5, "b:d": 6, "x:y:z": 17} pkeys, nkeys = collect_traffic_light_bounds(test_dict) assert nkeys == ["a"] assert len(pkeys) == 2 assert pkeys[...
{"c", "d"}
assert
collection
tests/popmon/alerting/test_compute_tl_bounds.py
test_collect_traffic_light_bounds
14
null
ing-bank/popmon
import pytest from popmon.alerting import ComputeTLBounds, collect_traffic_light_bounds def test_compute_traffic_light_funcs(): datastore = {"test_data": pytest.test_comparer_df} conf = { "monitoring_rules": { "the_feature:mae": [8, 4, 2, 2], "dummy_feature:*": [0, 0, 0, 0], ...
["mae"]
assert
collection
tests/popmon/alerting/test_compute_tl_bounds.py
test_compute_traffic_light_funcs
66
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
5
assert
numeric_literal
tests/popmon/analysis/test_hist_numpy.py
test_histogram
80
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
1
assert
numeric_literal
tests/popmon/alerting/test_apply_tl_bounds.py
test_traffic_light
35
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.comparison.hist_comparer import ReferenceHistComparer from popmon.base import Pipeline from popmon.config import Settings from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader from popmon.visualization imp...
0
assert
numeric_literal
tests/popmon/visualization/test_report_generator.py
test_report_generator
59
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd from conftest import make_mixed_dataframe from popmon.hist.hist_utils import ( is_numeric, is_timestamp, project_on_x, project_split2dhist_on_axis, sparse_bin_centers_x, split_hist_along_first_dimension, sum_entries, sum_o...
bin_edges3)
assert_*
variable
tests/popmon/hist/test_histogram.py
test_sum_over_x
210
null
ing-bank/popmon
from popmon import resources from popmon.io import JsonReader def test_json_reader(): jr = JsonReader(file_path=resources.data("example.json"), store_key="example") datastore = jr.transform(datastore={}) assert datastore["example"]["boolean"] assert len(datastore["example"]["array"]) == 3 assert ...
0
assert
numeric_literal
tests/popmon/io/test_json_reader.py
test_json_reader
11
null
ing-bank/popmon
import pytest from pydantic.error_wrappers import ValidationError from popmon import Settings def test_settings_docs_example(): settings = Settings() settings.time_axis = "date" assert settings.time_axis ==
"date"
assert
string_literal
tests/popmon/test_config.py
test_settings_docs_example
10
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd from conftest import make_mixed_dataframe from popmon.hist.hist_utils import ( is_numeric, is_timestamp, project_on_x, project_split2dhist_on_axis, sparse_bin_centers_x, split_hist_along_first_dimension, sum_entries, sum_o...
splitA1
assert
variable
tests/popmon/hist/test_histogram.py
test_project_split2dhist_on_axis
305
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd from conftest import make_mixed_dataframe from popmon.hist.hist_utils import ( is_numeric, is_timestamp, project_on_x, project_split2dhist_on_axis, sparse_bin_centers_x, split_hist_along_first_dimension, sum_entries, sum_o...
check3a)
assert_*
variable
tests/popmon/hist/test_histogram.py
test_split_hist_along_first_dimension
116
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
[np.nan] * 9 + [1.0] * 91)
assert_*
collection
tests/popmon/alerting/test_apply_tl_bounds.py
test_rolling_window_funcs
218
null
ing-bank/popmon
import pandas as pd from popmon.analysis.merge_statistics import MergeStatistics def test_merge_statistics(): df1 = pd.DataFrame( { "A": ["A0", "A1", "A2", "A3"], "B": ["B0", "B1", "B2", "B3"], "C": ["C0", "C1", "C2", "C3"], "D": ["D0", "D1", "D2", "D3"], ...
df1)
assert_*
variable
tests/popmon/analysis/test_merge_statistics.py
test_merge_statistics
48
null
ing-bank/popmon
import pandas as pd import pytest from popmon.alerting import AlertsSummary, ComputeTLBounds, traffic_light_summary from popmon.analysis.apply_func import ApplyFunc from popmon.base import Pipeline def test_traffic_light_summary_combination(): datastore = {"test_data": pytest.test_comparer_df} conf = { ...
alerts
assert
variable
tests/popmon/alerting/test_integration.py
test_traffic_light_summary_combination
136
null
ing-bank/popmon
from copy import deepcopy from pathlib import Path import pandas as pd import pytest from popmon.hist.filling import make_histograms from popmon.pipeline.metrics import df_stability_metrics def spark_context(): if not spark_found: return None current_path = Path(__file__).parent scala = "2.12" ...
list(ds.keys())
assert
func_call
tests/popmon/spark/test_spark.py
test_spark_stability_metrics
67
null
ing-bank/popmon
import histogrammar as hg import numpy as np import pandas as pd import pytest from conftest import make_mixed_dataframe from popmon.analysis.hist_numpy import ( assert_similar_hists, check_similar_hists, get_2dgrid, get_consistent_numpy_1dhists, get_consistent_numpy_2dgrids, get_consistent_num...
"Bin"
assert
string_literal
tests/popmon/analysis/test_hist_numpy.py
test_get_contentType
98
null
ing-bank/popmon
import pytest from popmon.base.registry import Registry def test_registry_duplicate(): DuplicatedRegistry = Registry() @DuplicatedRegistry.register(key="test", description="me") def func1(): pass with pytest.raises(ValueError) as e: @DuplicatedRegistry.register(key="another", descri...
"Key 'test' has already been registered."
assert
string_literal
tests/popmon/base/test_registry.py
test_registry_duplicate
72
null
ing-bank/popmon
import numpy as np import pytest from popmon.base import Module def test_popmon_module(test_module): datastore = {"x": np.arange(10)} datastore = test_module.transform(datastore) assert "x" in
datastore
assert
variable
tests/popmon/base/test_module.py
test_popmon_module
35
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon import resources from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.comparison import ( ExpandingNormHistComparer, ReferenceNormHistComparer, RollingNormHistComparer, ) from popmon.analysis.functions import ( expand, ...
4.25)
assert_*
numeric_literal
tests/popmon/analysis/test_functions.py
test_chi_squared1
550
null
ing-bank/popmon
import itertools import numpy as np from scipy import linalg, stats from popmon.stats.numpy import ( mean, probability_distribution_mean_covariance, quantile, std, ) def get_data(): rng = np.random.default_rng(5) a = rng.integers(0, 10, size=(3, 4, 5, 6)) w = rng.integers(0, 10, size=(3, ...
mean(a, w, axis=(1, 2), keepdims=True))
assert_*
func_call
tests/popmon/stats/test_numpy.py
test_statistics_1
149
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.analysis.hist_numpy import assert_similar_hists, check_similar_hists from popmon.base import Pipeline from popmon.hist.hist_splitter import HistSplitter from popmon.io import JsonReader def test_hist_splitter(): hist_list = [ "date...
hlist)
assert_*
variable
tests/popmon/hist/test_hist_splitter.py
test_hist_splitter
51
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon.alerting import ( ComputeTLBounds, DynamicBounds, StaticBounds, TrafficLightAlerts, pull_bounds, traffic_light, ) from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.functions import ( expanding_mean, exp...
2
assert
numeric_literal
tests/popmon/alerting/test_apply_tl_bounds.py
test_traffic_light
34
null
ing-bank/popmon
import copy import json import pandas as pd import pytest from popmon.io import FileWriter DATA = {"name": ["Name"], "surname": ["Surname"]} def get_ready_ds(): return copy.deepcopy({"my_data": DATA}) def to_json(data, **kwargs): return json.dumps(data, **kwargs) def to_pandas(data): return pd.DataFra...
to_json(DATA, indent=4)
assert
func_call
tests/popmon/io/test_file_writer.py
test_file_writer_json_with_kwargument
33
null
ing-bank/popmon
import pandas as pd import pytest from popmon import resources from popmon.base import Pipeline from popmon.config import Settings from popmon.hist.filling import get_bin_specs from popmon.io import JsonReader from popmon.pipeline.report import df_stability_report, stability_report def test_df_stability_report_self()...
bin_specs["date:latitude"][0]["binWidth"]
assert
complex_expr
tests/popmon/pipeline/test_report.py
test_df_stability_report_self
97
null
ing-bank/popmon
import numpy as np import pytest from popmon.analysis.comparison.comparisons import ( jensen_shannon_divergence, ks_prob, ks_test, kullback_leibler_divergence, population_stability_index, uu_chi2, ) @pytest.mark.filterwarnings("ignore:invalid value encountered in true_divide") def test_uu_chi2...
4)
assert_*
numeric_literal
tests/popmon/analysis/comparison/test_comparisons.py
test_uu_chi2
22
null
ing-bank/popmon
import numpy as np import pandas as pd import pytest from popmon import resources from popmon.analysis.apply_func import ApplyFunc from popmon.analysis.comparison import ( ExpandingNormHistComparer, ReferenceNormHistComparer, RollingNormHistComparer, ) from popmon.analysis.functions import ( expand, ...
datastore
assert
variable
tests/popmon/analysis/test_functions.py
test_normalized_hist_mean_cov
342
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(exec_plan.get_output("input_partitions").load_partitioned_datasets(npartitions, data_partition_column, hive_partitioning)))
self.assertEqual
func_call
tests/test_partition.py
run_test_plan
TestPartition
292
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_arrow(sp: Session): arrow_table = pa.table({"a": [1, 2, 3], "b": [4, 5, 6]}) df = sp.from_arrow(arrow_table) assert df.to_arrow() ==
arrow_table
assert
variable
tests/test_dataframe.py
test_arrow
19
null
deepseek-ai/smallpond
import os.path import queue import sys import unittest from concurrent.futures import ThreadPoolExecutor from datetime import datetime from multiprocessing import Manager, Process from typing import List, Optional import fsspec import numpy as np import psutil import pyarrow as arrow import pyarrow.compute as pc impor...
actual.shape)
self.assertEqual
complex_expr
tests/test_fabric.py
_compare_arrow_tables
TestFabric
265
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
table.num_rows)
self.assertEqual
complex_expr
tests/test_arrow.py
test_table_to_batches
TestArrow
112
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): @given(st.data()) ...
large_size)
self.assertEqual
variable
tests/test_common.py
test_split_into_cols
TestCommon
54
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
os.path.exists(os.path.join(output_path, "url_counts")))
self.assertTrue
func_call
tests/test_execution.py
test_override_output_path
TestExecution
678
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): @given(st.data()) ...
[x for row in itertools.zip_longest(*chunks) for x in row if x is not None])
self.assertListEqual
collection
tests/test_common.py
test_split_into_cols
TestCommon
47
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
len(os.listdir(copy_path)))
self.assertEqual
func_call
tests/test_execution.py
test_data_sink_avoid_filename_conflicts
TestExecution
699
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): @given(st.data()) ...
computed)
self.assertEqual
variable
tests/test_common.py
test_split_into_rows
TestCommon
38
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len( exec_plan.get_output("nested_hash_partitions").load_partitioned_datasets(npartitions_nested, "nested_hash_partitions") ))
self.assertEqual
func_call
tests/test_partition.py
test_empty_hash_partition
TestPartition
228
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
exec_plan.final_output.num_rows)
self.assertEqual
complex_expr
tests/test_partition.py
test_empty_hash_partition
TestPartition
215
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): def test_get_nth_part...
get_nth_partition(items, 1, 2))
self.assertListEqual
func_call
tests/test_common.py
test_get_nth_partition
TestCommon
19
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
loaded_table.num_rows)
self.assertEqual
complex_expr
tests/test_arrow.py
test_load_mixed_string_types
TestArrow
138
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_csv(sp: Session): df = sp.read_csv( "tests/data/mock_urls/*.tsv", schema={"urlstr": "varchar", "valstr": "varchar"}, delim=r"\t", ) assert df.count() ==...
1000
assert
numeric_literal
tests/test_dataframe.py
test_csv
35
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
pc.sum(exec_plan.final_output.to_arrow_table().column("row_count")).as_py())
self.assertEqual
func_call
tests/test_partition.py
test_hash_partition
TestPartition
140
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
dataset.num_rows)
self.assertEqual
complex_expr
tests/test_partition.py
test_many_row_partitions
TestPartition
71
null
deepseek-ai/smallpond
import os.path import random import time import unittest from typing import List, Tuple from loguru import logger from smallpond.execution.scheduler import ExecutorState from smallpond.execution.task import PythonScriptTask, RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.l...
0)
self.assertGreater
numeric_literal
tests/test_scheduler.py
test_failed_executors
TestScheduler
120
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
len(os.listdir(link_path)))
self.assertEqual
func_call
tests/test_execution.py
test_data_sink_avoid_filename_conflicts
TestExecution
698
null
deepseek-ai/smallpond
import os from smallpond.dataframe import Session def test_shutdown_cleanup(sp: Session): assert os.path.exists(sp._runtime_ctx.queue_root), "queue directory should exist" assert os.path.exists(sp._runtime_ctx.staging_root), "staging directory should exist" assert os.path.exists(sp._runtime_ctx.temp_root)...
fin.read()
assert
func_call
tests/test_session.py
test_shutdown_cleanup
21
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_limit(sp: Session): df = sp.from_items(list(range(1000))).repartition(10, by_rows=True) assert df.limit(2).count() ==
2
assert
numeric_literal
tests/test_dataframe.py
test_limit
136
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
exec_plan.get_output("random_urls_k10").to_arrow_table().num_rows)
self.assertEqual
func_call
tests/test_execution.py
test_partial_process_func
TestExecution
755
null
deepseek-ai/smallpond
import os.path import tempfile import threading import unittest from smallpond.io.filesystem import dump, load from tests.test_fabric import TestFabric class TestFilesystem(TestFabric, unittest.TestCase): def test_pickle_runtime_ctx(self): with tempfile.TemporaryDirectory(dir=self.output_root_abspath) as ...
runtime_ctx.job_id)
self.assertEqual
complex_expr
tests/test_filesystem.py
test_pickle_runtime_ctx
TestFilesystem
16
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(exec_plan.final_output.load_partitioned_datasets(npartitions_nested, "nested_hash_partitions")))
self.assertEqual
func_call
tests/test_partition.py
test_empty_hash_partition
TestPartition
220
null
deepseek-ai/smallpond
import os.path import random import time import unittest from typing import List, Tuple from loguru import logger from smallpond.execution.scheduler import ExecutorState from smallpond.execution.task import PythonScriptTask, RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.l...
latest_sched_state.success)
self.assertTrue
complex_expr
tests/test_scheduler.py
test_failed_executors
TestScheduler
119
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
set(filename for filename in os.listdir(copy_input_path) if filename.endswith(".parquet")))
self.assertEqual
func_call
tests/test_execution.py
test_data_sink_avoid_filename_conflicts
TestExecution
701
null
deepseek-ai/smallpond
import glob import os.path import unittest from pathlib import PurePath import duckdb import pandas import pyarrow as arrow import pytest from loguru import logger from smallpond.common import DEFAULT_ROW_GROUP_SIZE, MB from smallpond.logical.dataset import ParquetDataSet from smallpond.utility import ConcurrentIter ...
len(dataset_with_wildcards.resolved_paths))
self.assertEqual
func_call
tests/test_dataset.py
test_paths_with_char_ranges
TestDataSet
107
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(exec_plan.get_output("hash_partitions").load_partitioned_datasets(npartitions, "hash_partitions")))
self.assertEqual
func_call
tests/test_partition.py
test_empty_hash_partition
TestPartition
224
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): def test_get_nth_part...
get_nth_partition(items, 1, 3))
self.assertListEqual
func_call
tests/test_common.py
test_get_nth_partition
TestCommon
22
null
deepseek-ai/smallpond
import os.path import unittest import uuid from loguru import logger from benchmarks.gray_sort_benchmark import gray_sort_benchmark from examples.sort_mock_urls import sort_mock_urls from smallpond.common import GB, MB from smallpond.execution.driver import Driver from tests.test_fabric import TestFabric class TestD...
0)
self.assertGreater
numeric_literal
tests/test_driver.py
test_standalone_mode
TestDriver
31
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_filter(sp: Session): df = sp.from_arrow(pa.table({"a": [1, 2, 3], "b": [4, 5, 6]})) df1 = df.filter("a > 1") assert df1.to_arrow() ==
pa.table({"a": [2, 3], "b": [5, 6]})
assert
func_call
tests/test_dataframe.py
test_filter
88
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
sum(batch.num_rows for batch in batch_reader))
self.assertEqual
func_call
tests/test_arrow.py
test_load_mixed_string_types
TestArrow
140
null