Skip to content

Commit

Permalink
chore: pin harness ff version range, add warning if dataset name pass…
Browse files Browse the repository at this point in the history
…ed as user kwarg in factory
  • Loading branch information
z3z1ma committed May 8, 2024
1 parent 60c34ba commit bf4b1f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"sqlmesh",
"dlt[duckdb]",
"typer[all]>=0.8.0",
"harness-featureflags>=1.2.0",
"harness-featureflags>=1.2.0,<1.6.1",
"python-dotenv>=1.0.0",
"pex>=2.1.100,<2.2.0",
"pydantic>=2.5.0,<3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/cdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import cdf.core.context as context
import cdf.core.logger as logger
from cdf.core.project import Project, Workspace, load_project
from cdf.core.runtime.pipeline import pipeline_factory as pipeline
from cdf.core.runtime import pipeline_factory as pipeline
from cdf.types import M, PathLike


Expand Down
3 changes: 2 additions & 1 deletion src/cdf/core/runtime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from cdf.core.runtime.notebook import execute_notebook_specification
from cdf.core.runtime.pipeline import execute_pipeline_specification
from cdf.core.runtime.pipeline import execute_pipeline_specification, pipeline_factory
from cdf.core.runtime.publisher import execute_publisher_specification
from cdf.core.runtime.script import execute_script_specification

Expand All @@ -8,4 +8,5 @@
"execute_pipeline_specification",
"execute_publisher_specification",
"execute_script_specification",
"pipeline_factory",
]
9 changes: 8 additions & 1 deletion src/cdf/core/runtime/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,18 @@ def pipeline_factory(**user_options: t.Any) -> RuntimePipeline:
Args:
**user_options: Kwargs which override the context options. All dlt.pipeline options can
be passed here except _impl_cls.
be passed here except _impl_cls. Passing dataset_name here will raise a warning.
Raises:
ValueError if the runtime context is not set.
"""
# NOTE: consider Tracer class which tracks dataset_name + pipeline_name combinations in the factory
# and stored them in a set? Same in pipeline run/load methods
if "dataset_name" in user_options:
logger.warning(
"Using dataset_name in a cdf pipeline should only be done if you know what you are doing."
" cdf will automatically manage the dataset name for you and relies on deterministic naming."
)
runtime = CONTEXT.get()
context_options = {
"pipeline_name": runtime.pipeline_name,
Expand Down

0 comments on commit bf4b1f1

Please sign in to comment.