cloe-nessy 0.3.9__py3-none-any.whl → 0.3.10__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.
@@ -234,15 +234,26 @@ class Table(TemplateLoaderMixin, ReadInstancesMixin, LoggerMixin):
234
234
 
235
235
  def get_create_statement(
236
236
  self,
237
- templates: Path = Path("./src/cloe_nessy/models/templates/"),
238
- template_name: str = "create_table.sql.j2",
239
237
  replace: bool = True,
240
238
  ):
241
- """Get the create statement for the Table."""
239
+ """Get the create statement for the Table.
240
+
241
+ Args:
242
+ replace: Whether to use the REPLACE statement or not.
243
+
244
+ Returns:
245
+ The rendered create statement for the Table.
246
+
247
+ Raises:
248
+ TemplateNotFound: If the template file is not found.
249
+ """
250
+ templates = Path(__file__).parent / "templates"
251
+ template_name = "create_table.sql.j2"
252
+
242
253
  try:
243
254
  template = self.get_template(templates, template_name)
244
255
  except TemplateNotFound as err:
245
- self._console_logger.error(f"Template [ {template_name} ] not found.")
256
+ self._console_logger.error("Template [ {template_name} ] not found.")
246
257
  raise err
247
258
  render = template.render(table=self, replace=replace)
248
259
  return render
@@ -54,14 +54,23 @@ class Volume(TemplateLoaderMixin, LoggerMixin, BaseModel):
54
54
 
55
55
  def get_create_statement(
56
56
  self,
57
- templates: Path = Path("./src/cloe_nessy/models/templates/"),
58
- template_name: str = "create_volume.sql.j2",
57
+ if_not_exists: bool = True,
59
58
  ):
60
- """Get the create statement for the Volume."""
59
+ """Get the create statement for the Volume.
60
+
61
+ Args:
62
+ if_not_exists: Whether to include the IF NOT EXISTS clause in the create statement
63
+
64
+ Returns:
65
+ The rendered create statement as a string.
66
+ """
67
+ template_name: str = "create_volume.sql.j2"
68
+ templates = Path(__file__).parent / "templates"
69
+
61
70
  try:
62
71
  template = self.get_template(templates, template_name)
63
72
  except TemplateNotFound as err:
64
73
  self._console_logger.error(f"Template [ {template_name} ] not found.")
65
74
  raise err
66
- render = template.render(volume=self)
75
+ render = template.render(volume=self, if_not_exists=if_not_exists)
67
76
  return render
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloe-nessy
3
- Version: 0.3.9
3
+ Version: 0.3.10
4
4
  Summary: Your friendly datalake monster.
5
5
  Author-email: initions <ICSMC_EXT_PYPIORG@accenture.com>
6
6
  License: MIT
@@ -42,9 +42,9 @@ cloe_nessy/models/column.py,sha256=53fBwRnino72XKACsHZpN9QfCBqqSXyKLHZlM0huumg,1
42
42
  cloe_nessy/models/constraint.py,sha256=hsFlhn4n928z81O3dl3v5bMetewPWzMjkJK3_4kASSM,178
43
43
  cloe_nessy/models/foreign_key.py,sha256=DwRVHs9sShqqPV-NL7ow_3AmPPWX0Od26yZn_I565pU,1001
44
44
  cloe_nessy/models/schema.py,sha256=yUrjjEhAH5zbCymE67Az_jPnVB8hGO-_UNfqzeZCD_Y,3376
45
- cloe_nessy/models/table.py,sha256=V1gsne79I-DQ47jTHNhGjWsg4i8io-VC9rv0PjlXDNQ,11848
45
+ cloe_nessy/models/table.py,sha256=1N79hc79uJbNw5tHuoQAhLLS6y-9TFx5LIQT-C1X-wU,12075
46
46
  cloe_nessy/models/types.py,sha256=XRbuJGdTNa6aXyE3IAzs_J9gVjbfkzMDLfGl-k6jI_4,223
47
- cloe_nessy/models/volume.py,sha256=7_lH4X-Au8jYNRVFQ5F2x-fRy2J8Z5-cLTn3Z3mpLQs,2197
47
+ cloe_nessy/models/volume.py,sha256=51BE06FrL1Wv6zblFwJ_HTiR6WQqH7pSmrdH90rqwLg,2444
48
48
  cloe_nessy/models/adapter/__init__.py,sha256=m36W_mqwB3dCYnCIt0fLOSHS4E1VU8FRGoaum4Gf95o,90
49
49
  cloe_nessy/models/adapter/unity_catalog_adapter.py,sha256=a-14Ys-AevVYQd0xeJU1syLxjT5Wzo4uog1hFSEs76M,12651
50
50
  cloe_nessy/models/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -92,7 +92,7 @@ cloe_nessy/settings/__init__.py,sha256=ZbkneO3WaKOxon7qHFHnou7EnBOSnBFyKMDZblIEv
92
92
  cloe_nessy/settings/settings.py,sha256=I4n129lrujriW-d8q4as2Kb4_kI932ModfZ5Ow_UpVM,3653
93
93
  cloe_nessy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
94
  cloe_nessy/utils/file_and_directory_handler.py,sha256=r2EVt9xG81p6ScaJCwETC5an6pMT6WseB0jMOR-JlpU,602
95
- cloe_nessy-0.3.9.dist-info/METADATA,sha256=TUUpWkn2wjKwCwkLdCh0gkmXlebXo6XEEjsvzUs74n8,3161
96
- cloe_nessy-0.3.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
- cloe_nessy-0.3.9.dist-info/top_level.txt,sha256=Z7izn8HmQpg2wBUb-0jzaKlYKMU7Ypzuc9__9vPtW_I,11
98
- cloe_nessy-0.3.9.dist-info/RECORD,,
95
+ cloe_nessy-0.3.10.dist-info/METADATA,sha256=NBGGYODGPrVIhK3HBYkRSCUkd3tvBnU0AsYqB2j90Js,3162
96
+ cloe_nessy-0.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
+ cloe_nessy-0.3.10.dist-info/top_level.txt,sha256=Z7izn8HmQpg2wBUb-0jzaKlYKMU7Ypzuc9__9vPtW_I,11
98
+ cloe_nessy-0.3.10.dist-info/RECORD,,