Skip to content

Commit 215a7ea

Browse files
authored
make schema.py and load.py publicly accessible (#23)
1 parent 7316b11 commit 215a7ea

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ While in this phase, we will denote breaking changes with a minor increase.
1717
* `dac` does not rely on [`pydantic`](https://pypi.org/project/pydantic/) anymore, and uses [`dataclass`](https://docs.python.org/3/library/dataclasses.html#) instead.
1818
Changes affect `PackConfig` and `PyProjectConfig`.
1919
* `Schema` does not have to be a `pandera.DataFrameModel` anymore, but any class that implements a `validate` method (see the `_input.interface.Validator` protocol).
20+
* `load.py` and `schema.py` are publicly accessible under `dac_pkg_name.load` and `dac_pkg_name.schema` respectively. Previously they were marked as private modules, under `dac_pkg_name._load` and `dac_pkg_name._schema`.
2021

2122
## 0.3.3
2223

src/dac/_pyproject_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class DaCProjectFactory:
6-
load_file_name = "_load.py"
7-
schema_file_name = "_schema.py"
6+
load_file_name = "load.py"
7+
schema_file_name = "schema.py"
88

99
def __init__(self, project_dir: Path, load_path: Path, schema_path: Path, project_name: str, pyproject_toml: str):
1010
self._project_dir = project_dir

test/unit_test/_packing/data_as_code_project_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def test_if_project_init_is_inspected_then_load_and_schema_is_found():
2525
with input_with_self_contained_data() as config:
2626
with data_as_code_project(config=config) as proj_dir:
2727
init_content = (proj_dir / "src" / config.pyproject.project_name / "__init__.py").read_text()
28-
assert f"from {config.pyproject.project_name}._load import load" in init_content
29-
assert f"from {config.pyproject.project_name}._schema import Schema" in init_content
28+
assert f"from {config.pyproject.project_name}.load import load" in init_content
29+
assert f"from {config.pyproject.project_name}.schema import Schema" in init_content
3030

3131

3232
def test_if_project_load_is_inspected_then_has_same_content_as_original():

0 commit comments

Comments
 (0)