lsst-felis 27.2024.3100__py3-none-any.whl → 27.2024.3200__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.

Potentially problematic release.


This version of lsst-felis might be problematic. Click here for more details.

felis/cli.py CHANGED
@@ -71,7 +71,7 @@ def cli(log_level: str, log_file: str | None) -> None:
71
71
 
72
72
 
73
73
  @cli.command("create", help="Create database objects from the Felis file")
74
- @click.option("--engine-url", envvar="ENGINE_URL", help="SQLAlchemy Engine URL", default="sqlite://")
74
+ @click.option("--engine-url", envvar="FELIS_ENGINE_URL", help="SQLAlchemy Engine URL", default="sqlite://")
75
75
  @click.option("--schema-name", help="Alternate schema name to override Felis file")
76
76
  @click.option(
77
77
  "--initialize",
@@ -86,6 +86,7 @@ def cli(log_level: str, log_file: str | None) -> None:
86
86
  @click.option(
87
87
  "--output-file", "-o", type=click.File(mode="w"), help="Write SQL commands to a file instead of executing"
88
88
  )
89
+ @click.option("--ignore-constraints", is_flag=True, help="Ignore constraints when creating tables")
89
90
  @click.argument("file", type=click.File())
90
91
  def create(
91
92
  engine_url: str,
@@ -95,6 +96,7 @@ def create(
95
96
  echo: bool,
96
97
  dry_run: bool,
97
98
  output_file: IO[str] | None,
99
+ ignore_constraints: bool,
98
100
  file: IO,
99
101
  ) -> None:
100
102
  """Create database objects from the Felis file.
@@ -115,6 +117,8 @@ def create(
115
117
  Dry run only to print out commands instead of executing.
116
118
  output_file
117
119
  Write SQL commands to a file instead of executing.
120
+ ignore_constraints
121
+ Ignore constraints when creating tables.
118
122
  file
119
123
  Felis file to read.
120
124
  """
@@ -132,7 +136,7 @@ def create(
132
136
  dry_run = True
133
137
  logger.info("Forcing dry run for non-sqlite engine URL with no host")
134
138
 
135
- metadata = MetaDataBuilder(schema).build()
139
+ metadata = MetaDataBuilder(schema, ignore_constraints=ignore_constraints).build()
136
140
  logger.debug(f"Created metadata with schema name: {metadata.schema}")
137
141
 
138
142
  engine: Engine | MockConnection
@@ -208,7 +212,7 @@ def init_tap(
208
212
  tables are created in the database schema specified by the engine URL,
209
213
  which must be a PostgreSQL schema or MySQL database that already exists.
210
214
  """
211
- engine = create_engine(engine_url, echo=True)
215
+ engine = create_engine(engine_url)
212
216
  init_tables(
213
217
  tap_schema_name,
214
218
  tap_schemas_table,
@@ -221,7 +225,7 @@ def init_tap(
221
225
 
222
226
 
223
227
  @cli.command("load-tap", help="Load metadata from a Felis file into a TAP_SCHEMA database")
224
- @click.option("--engine-url", envvar="ENGINE_URL", help="SQLAlchemy Engine URL to catalog")
228
+ @click.option("--engine-url", envvar="FELIS_ENGINE_URL", help="SQLAlchemy Engine URL")
225
229
  @click.option("--schema-name", help="Alternate Schema Name for Felis file")
226
230
  @click.option("--catalog-name", help="Catalog Name for Schema")
227
231
  @click.option("--dry-run", is_flag=True, help="Dry Run Only. Prints out the DDL that would be executed")
felis/metadata.py CHANGED
@@ -127,10 +127,16 @@ class MetaDataBuilder:
127
127
  Whether to apply the schema name to the metadata object.
128
128
  apply_schema_to_tables
129
129
  Whether to apply the schema name to the tables.
130
+ ignore_constraints
131
+ Whether to ignore constraints when building the metadata.
130
132
  """
131
133
 
132
134
  def __init__(
133
- self, schema: Schema, apply_schema_to_metadata: bool = True, apply_schema_to_tables: bool = True
135
+ self,
136
+ schema: Schema,
137
+ apply_schema_to_metadata: bool = True,
138
+ apply_schema_to_tables: bool = True,
139
+ ignore_constraints: bool = False,
134
140
  ) -> None:
135
141
  """Initialize the metadata builder."""
136
142
  self.schema = schema
@@ -141,6 +147,7 @@ class MetaDataBuilder:
141
147
  self.metadata = MetaData(schema=schema.name if apply_schema_to_metadata else None)
142
148
  self._objects: dict[str, Any] = {}
143
149
  self.apply_schema_to_tables = apply_schema_to_tables
150
+ self.ignore_constraints = ignore_constraints
144
151
 
145
152
  def build(self) -> MetaData:
146
153
  """Build the SQLAlchemy tables and constraints from the schema.
@@ -157,7 +164,10 @@ class MetaDataBuilder:
157
164
  The SQLAlchemy metadata object.
158
165
  """
159
166
  self.build_tables()
160
- self.build_constraints()
167
+ if not self.ignore_constraints:
168
+ self.build_constraints()
169
+ else:
170
+ logger.warning("Ignoring constraints")
161
171
  return self.metadata
162
172
 
163
173
  def build_tables(self) -> None:
felis/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "27.2024.3100"
2
+ __version__ = "27.2024.3200"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lsst-felis
3
- Version: 27.2024.3100
3
+ Version: 27.2024.3200
4
4
  Summary: A vocabulary for describing catalogs and acting on those descriptions
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: GNU General Public License v3 or later (GPLv3+)
@@ -1,11 +1,11 @@
1
1
  felis/__init__.py,sha256=THmRg3ylB4E73XhFjJX7YlnV_CM3lr_gZO_HqQFzIQ4,937
2
- felis/cli.py,sha256=fi0p3clKxpFmvWS-CF7t1J14As3QpRgdE9Xlwi8yEoY,14147
2
+ felis/cli.py,sha256=iXZ3ViMKAC45OHOT5OSPW0aqSxOTG2Oa0qrgbADKD7A,14378
3
3
  felis/datamodel.py,sha256=f0iHz2N0mXOWNBUPfmXO9bDmALKG1UUJPvFp_oPo4jU,26598
4
- felis/metadata.py,sha256=V53FKn_Z7ep7cxl-J3B7opatFNqcjuVD77ysYROySr8,13421
4
+ felis/metadata.py,sha256=JgqZeFqGFuuahOKL2jLrh3KDZhjILQJoS2_p3P8lKNE,13739
5
5
  felis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  felis/tap.py,sha256=pyLHBWzXCw4F1wDbQiyxyJYPQcye4It2yRuVFoQQK5I,21746
7
7
  felis/types.py,sha256=m80GSGfNHQ3-NzRuTzKOyRXLJboPxdk9kzpp1SO8XdY,5510
8
- felis/version.py,sha256=oZnCZ1UTtd2f7pWd7N0kLSrQdjvhUIp0fEH6no4GZZE,55
8
+ felis/version.py,sha256=ILK6cI4SqpVQCHo84oBZggDrt3tZYA22XxOe3o-5uxA,55
9
9
  felis/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  felis/db/dialects.py,sha256=n5La-shu-8fHLIyf8rrazHDyrzATmMCdELtKV_0ymxI,3517
11
11
  felis/db/sqltypes.py,sha256=JJy97U8KzAOg5pFi2xZgSjvU8CXXgrzkvCsmo6FLRG4,11060
@@ -13,11 +13,11 @@ felis/db/utils.py,sha256=I8t9Yui98T8iPyrs0Q-qyjjaxVyX8kQkyizvzv-p4FE,11526
13
13
  felis/db/variants.py,sha256=eahthrbVeV8ZdGamWQccNmWgx6CCscGrU0vQRs5HZK8,5260
14
14
  felis/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  felis/tests/postgresql.py,sha256=B_xk4fLual5-viGDqP20r94okuc0pbSvytRH_L0fvMs,4035
16
- lsst_felis-27.2024.3100.dist-info/COPYRIGHT,sha256=vJAFLFTSF1mhy9eIuA3P6R-3yxTWKQgpig88P-1IzRw,129
17
- lsst_felis-27.2024.3100.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
18
- lsst_felis-27.2024.3100.dist-info/METADATA,sha256=DPMMNI6gOqngZwBdFf0hSRvvQ2wgIRC5ZF5d8iPQhf4,1288
19
- lsst_felis-27.2024.3100.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
20
- lsst_felis-27.2024.3100.dist-info/entry_points.txt,sha256=Gk2XFujA_Gp52VBk45g5kim8TDoMDJFPctsMqiq72EM,40
21
- lsst_felis-27.2024.3100.dist-info/top_level.txt,sha256=F4SvPip3iZRVyISi50CHhwTIAokAhSxjWiVcn4IVWRI,6
22
- lsst_felis-27.2024.3100.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
- lsst_felis-27.2024.3100.dist-info/RECORD,,
16
+ lsst_felis-27.2024.3200.dist-info/COPYRIGHT,sha256=vJAFLFTSF1mhy9eIuA3P6R-3yxTWKQgpig88P-1IzRw,129
17
+ lsst_felis-27.2024.3200.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
18
+ lsst_felis-27.2024.3200.dist-info/METADATA,sha256=sNmsU8ahuIhHffoK6Qhs69UF3yDjylyKoe8o1l0b-SA,1288
19
+ lsst_felis-27.2024.3200.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
20
+ lsst_felis-27.2024.3200.dist-info/entry_points.txt,sha256=Gk2XFujA_Gp52VBk45g5kim8TDoMDJFPctsMqiq72EM,40
21
+ lsst_felis-27.2024.3200.dist-info/top_level.txt,sha256=F4SvPip3iZRVyISi50CHhwTIAokAhSxjWiVcn4IVWRI,6
22
+ lsst_felis-27.2024.3200.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
+ lsst_felis-27.2024.3200.dist-info/RECORD,,