Exemplo n.º 1
0
def init():
    return readDSExport(
        "Data-pxStrategyResult_pxInteractionHistory_20210101T010000_GMT.zip",
        path="data",
    )
def test_import_zipped_json_pandas():
    path = "data"
    models = "Data-Decision-ADM-ModelSnapshot_pyModelSnapshots_20210101T010000_GMT.zip"
    assert checks(
        cdh_utils.readDSExport(path=path, filename=models, force_pandas=True))
def test_dataframe_returns_itself(test_data):
    input = test_data
    assert cdh_utils.readDSExport(input).equals(input)
def test_file_not_found_in_bad_dir():
    with pytest.raises(FileNotFoundError):
        cdh_utils.readDSExport(path="data1", filename="modelData")
def test_import_csv_pandas():
    path = "data"
    models = "pr_data_dm_admmart_mdl_fact.csv"
    assert checks(
        cdh_utils.readDSExport(path=path, filename=models, force_pandas=True))
def test_file_not_found_in_good_dir():
    assert cdh_utils.readDSExport(path="data", filename="models") == None
def test_cdh_sample_autodiscovered_locally():
    path = "data"
    assert checks(cdh_utils.readDSExport(path=path, filename="modelData"))
def test_cdh_sample_models_locally():
    path = "data"
    models = "Data-Decision-ADM-ModelSnapshot_pyModelSnapshots_20210101T010000_GMT.zip"
    assert checks(cdh_utils.readDSExport(path=path, filename=models))
def test_cdh_sample_models_from_url():
    path = "https://raw.githubusercontent.com/pegasystems/cdh-datascientist-tools/master/data"
    models = "Data-Decision-ADM-ModelSnapshot_pyModelSnapshots_20210101T010000_GMT.zip"
    assert checks(cdh_utils.readDSExport(path=path, filename=models))
def test_csv_from_url():
    path = "https://raw.githubusercontent.com/pegasystems/cdh-datascientist-tools/master/data"
    models = "pr_data_dm_admmart_mdl_fact.csv"
    assert checks(cdh_utils.readDSExport(path=path, filename=models))