refactor to allow for multiple code locations
This commit is contained in:
40
apps/vinyl/src/test.py
Normal file
40
apps/vinyl/src/test.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import logging
|
||||
import warnings
|
||||
from datetime import datetime
|
||||
|
||||
from assets import deals
|
||||
from dagster_polars import PolarsParquetIOManager
|
||||
from jobs import check_partititions_job
|
||||
|
||||
from dagster import materialize
|
||||
|
||||
warnings.filterwarnings("ignore", category=UserWarning)
|
||||
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
resources = {
|
||||
"polars_parquet_io_manager": PolarsParquetIOManager(base_dir="/opt/dagster/storage")
|
||||
}
|
||||
|
||||
|
||||
def test_deals(source="sounds", date: str = None):
|
||||
if not date:
|
||||
today = datetime.today().strftime("%Y-%m-%d")
|
||||
date = today
|
||||
|
||||
result = materialize(
|
||||
[deals],
|
||||
partition_key=f"{date}|{source}",
|
||||
resources=resources,
|
||||
run_config={
|
||||
"loggers": {"console": {"config": {"log_level": "ERROR"}}},
|
||||
"ops": {"deals": {"config": {"import_dir": "/opt/dagster/storage/import"}}},
|
||||
},
|
||||
)
|
||||
assert result.success
|
||||
ic(result.asset_value)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# test_deals(source="plato")
|
||||
check_partititions_job.execute_in_process()
|
||||
Reference in New Issue
Block a user