floe-python 0.10.0__py3-none-any.whl → 0.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
floe/add_entity.py CHANGED
@@ -367,6 +367,9 @@ def _included_domain(
367
367
  raise FloeConfigError(f"failed to parse domain file {file}: {e}") from e
368
368
  doc = docs[0] if docs else None
369
369
  if isinstance(doc, dict) and cast(Hash, doc).get("name") == domain:
370
+ # ponytail: a sibling would not load; writing into the glob's folder is the upgrade
371
+ if "entities" in doc:
372
+ raise FloeConfigError(f"domain file {file} sets entities; add-entity writes only sibling entity files, so create this one by hand") # fmt: skip
370
373
  return os.path.dirname(file), cast(Hash, doc).get("defaults", {})
371
374
  return None
372
375
 
floe/config/include.py CHANGED
@@ -30,6 +30,21 @@ def glob_base(directory: Path) -> str:
30
30
  return Pattern.escape(text)
31
31
 
32
32
 
33
+ def _entity_files(domain: Hash, domain_file: Path) -> list[Path]:
34
+ """Its `entities` glob (#1213) if the domain file sets one, else its sibling `*.yml` files."""
35
+ directory = domain_file.parent
36
+ if "entities" not in domain:
37
+ files = [p for p in directory.iterdir() if p.suffix == ".yml"]
38
+ else:
39
+ pattern = yaml_string(domain.pop("entities"), "domains.entities")
40
+ files = [Path(m) for m in glob(os.path.join(glob_base(directory), pattern))]
41
+ if not files:
42
+ raise FloeConfigError(
43
+ f"domains.entities pattern {pattern!r} matched no file"
44
+ )
45
+ return sorted(p for p in files if p.resolve() != domain_file.resolve())
46
+
47
+
33
48
  def assemble_includes(
34
49
  doc: object, config_dir: Path, config_files: list[Path]
35
50
  ) -> IncludeOrigins:
@@ -80,17 +95,13 @@ def assemble_includes(
80
95
  for match in matches:
81
96
  domain_file = Path(match)
82
97
  with at_file(domain_file):
83
- domain = load_single_doc(domain_file)
84
- name = get_string(yaml_hash(domain, "domains"), "name", "domains")
98
+ domain = yaml_hash(load_single_doc(domain_file), "domains")
99
+ name = get_string(domain, "name", "domains")
100
+ entity_files = _entity_files(domain, domain_file)
85
101
  config_files.append(domain_file)
86
102
  domains.append((domain, domain_file))
87
103
  # D4: an entity's name comes from its YAML, never from its file name, so `con.yml` loads like any other
88
- siblings = [
89
- p
90
- for p in domain_file.parent.iterdir()
91
- if p != domain_file and p.suffix == ".yml"
92
- ]
93
- for entity_file in sorted(siblings):
104
+ for entity_file in entity_files:
94
105
  with at_file(entity_file):
95
106
  loaded = load_single_doc(entity_file)
96
107
  if not isinstance(loaded, dict):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: floe-python
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Floe: a data-contract runtime for file ingestion
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -2,7 +2,7 @@ floe/__init__.py,sha256=lskEWBsQyadsBTuU15HGnlQlj_xgxOYkntfYz11QbvY,13450
2
2
  floe/__main__.py,sha256=Nzz6wrGXRpJiO59qlX7WEJRTlb-XcRFswmP0TA2KjyM,57
3
3
  floe/_cli.py,sha256=cKg3idqFG4PgPEoBixPx9A82_Uhxml5AJTFtGziB094,14592
4
4
  floe/_cli_output.py,sha256=6DBAR3cNW2kFW_QGkwP1PpVC8AbvOjQW1LMaGnmC3qs,9232
5
- floe/add_entity.py,sha256=t7PvMs-Hi2a5GzWhZ-73VErOjJIFeEZroTNK4em0sog,21954
5
+ floe/add_entity.py,sha256=Ih613ZdoKUFBMcIf09BgEZg82Lc-AGsHoxd1HEpw-JI,22257
6
6
  floe/errors.py,sha256=wRm6PvrEfIz16YZR06lEGxwNhpbrIPbfMXV2hxMTgdM,586
7
7
  floe/extras.py,sha256=H8cYWz1aV99Y9ClcejFfGXW5n08sIoeLAkoSt0TK8E4,613
8
8
  floe/glob.py,sha256=A0HdePLXLGl1T6heJbgdrNHr8pZfdidG7pQ1QsXWOl8,10579
@@ -19,7 +19,7 @@ floe/checks/rows.py,sha256=_DsRfPm5ke_yujzM-4F5ToQY6aAa5RVJQCGpZpyCkDc,4666
19
19
  floe/checks/unique.py,sha256=ZVckMOoGuKIzq3M84TGeZ1ks0nab9YTaI54w5Q_rjZc,10864
20
20
  floe/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  floe/config/entity.py,sha256=1G9_Oguo5Jp4X1SOsjDuu9A6Hs1HZnvbVk7DruA_Swg,16076
22
- floe/config/include.py,sha256=4LjX4fDcH6Icl_ax4KrnrMHwJjTif0A0vu022zSfBm0,4987
22
+ floe/config/include.py,sha256=59EJBE7yGJkBjCYzmwnWkhmuWGm8r5uaGaFxf_F0XS4,5573
23
23
  floe/config/parse.py,sha256=B3gOi80-M0y9Y4OyNjM4MYmM2mFHKGVpqipX1JqaLjM,5290
24
24
  floe/config/profile.py,sha256=GkqJDfDTmvCkK1ZxTlIdHgQJOt1PS-5_qYnOkMzIf0U,18561
25
25
  floe/config/project.py,sha256=hrSBVeyirWHODYXzHTil8iR5ZvjpvpL_eYNjmHW5qrg,14584
@@ -65,8 +65,8 @@ floe/storage/s3.py,sha256=PW11xRl8xzyf4ntM-w51eDW14CVd66pCqsaMXpkftPw,9499
65
65
  floe/storage/types.py,sha256=nmBJ1aMkBFCv4UFFoDJoci5BxC6cKRvLw_eNl-DKLlM,1254
66
66
  floe/write/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  floe/write/outputs.py,sha256=NTCfLzna0B6-VJS9izh-3wrphVbsLTCaHLf1rV-Ls6w,8301
68
- floe_python-0.10.0.dist-info/METADATA,sha256=6C4XBJJ8SlLs4BPW9-7HRvYvUGfS9B19gTbkZimqYyU,881
69
- floe_python-0.10.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
70
- floe_python-0.10.0.dist-info/entry_points.txt,sha256=DU75r-E3zcK0quvwg5iT5DeWbUJck_Tz80bEj1IIzHA,40
71
- floe_python-0.10.0.dist-info/licenses/LICENSE,sha256=dUhuoK-TCRQMpuLEAdfme-qPSJI0TlcH9jlNxeg9_EQ,1056
72
- floe_python-0.10.0.dist-info/RECORD,,
68
+ floe_python-0.10.1.dist-info/METADATA,sha256=6ZOBOwKEQmPH-KxjTTzn5mdiKf3u9nYVBmueOnN-x_Q,881
69
+ floe_python-0.10.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
70
+ floe_python-0.10.1.dist-info/entry_points.txt,sha256=DU75r-E3zcK0quvwg5iT5DeWbUJck_Tz80bEj1IIzHA,40
71
+ floe_python-0.10.1.dist-info/licenses/LICENSE,sha256=dUhuoK-TCRQMpuLEAdfme-qPSJI0TlcH9jlNxeg9_EQ,1056
72
+ floe_python-0.10.1.dist-info/RECORD,,