lsst-felis 28.2024.4500__py3-none-any.whl → 30.0.0rc3__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.
- felis/__init__.py +9 -1
- felis/cli.py +308 -209
- felis/config/tap_schema/columns.csv +33 -0
- felis/config/tap_schema/key_columns.csv +8 -0
- felis/config/tap_schema/keys.csv +8 -0
- felis/config/tap_schema/schemas.csv +2 -0
- felis/config/tap_schema/tables.csv +6 -0
- felis/config/tap_schema/tap_schema_extensions.yaml +73 -0
- felis/datamodel.py +599 -59
- felis/db/{dialects.py → _dialects.py} +69 -4
- felis/db/{variants.py → _variants.py} +1 -1
- felis/db/database_context.py +917 -0
- felis/diff.py +234 -0
- felis/metadata.py +89 -19
- felis/tap_schema.py +271 -166
- felis/tests/postgresql.py +1 -1
- felis/tests/run_cli.py +79 -0
- felis/types.py +7 -7
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info}/METADATA +20 -16
- lsst_felis-30.0.0rc3.dist-info/RECORD +31 -0
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info}/WHEEL +1 -1
- felis/db/utils.py +0 -409
- felis/tap.py +0 -597
- felis/tests/utils.py +0 -122
- felis/version.py +0 -2
- lsst_felis-28.2024.4500.dist-info/RECORD +0 -26
- felis/{schemas → config/tap_schema}/tap_schema_std.yaml +0 -0
- felis/db/{sqltypes.py → _sqltypes.py} +7 -7
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info}/entry_points.txt +0 -0
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info/licenses}/COPYRIGHT +0 -0
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info/licenses}/LICENSE +0 -0
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info}/top_level.txt +0 -0
- {lsst_felis-28.2024.4500.dist-info → lsst_felis-30.0.0rc3.dist-info}/zip-safe +0 -0
felis/tests/utils.py
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"""Test utility functions."""
|
|
2
|
-
|
|
3
|
-
# This file is part of felis.
|
|
4
|
-
#
|
|
5
|
-
# Developed for the LSST Data Management System.
|
|
6
|
-
# This product includes software developed by the LSST Project
|
|
7
|
-
# (https://www.lsst.org).
|
|
8
|
-
# See the COPYRIGHT file at the top-level directory of this distribution
|
|
9
|
-
# for details of code ownership.
|
|
10
|
-
#
|
|
11
|
-
# This program is free software: you can redistribute it and/or modify
|
|
12
|
-
# it under the terms of the GNU General Public License as published by
|
|
13
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
14
|
-
# (at your option) any later version.
|
|
15
|
-
#
|
|
16
|
-
# This program is distributed in the hope that it will be useful,
|
|
17
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
# GNU General Public License for more details.
|
|
20
|
-
#
|
|
21
|
-
# You should have received a copy of the GNU General Public License
|
|
22
|
-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
|
-
|
|
24
|
-
import logging
|
|
25
|
-
import os
|
|
26
|
-
import shutil
|
|
27
|
-
import tempfile
|
|
28
|
-
from collections.abc import Iterator
|
|
29
|
-
from contextlib import contextmanager
|
|
30
|
-
from typing import IO
|
|
31
|
-
|
|
32
|
-
__all__ = ["open_test_file", "mk_temp_dir", "rm_temp_dir"]
|
|
33
|
-
|
|
34
|
-
TEST_DATA_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "..", "tests", "data"))
|
|
35
|
-
"""The directory containing test data files."""
|
|
36
|
-
|
|
37
|
-
TEST_TMP_DIR = os.path.normpath(os.path.join(TEST_DATA_DIR, ".."))
|
|
38
|
-
"""The directory for temporary files."""
|
|
39
|
-
|
|
40
|
-
__all__ = ["open_test_file", "mk_temp_dir", "rm_temp_dir"]
|
|
41
|
-
|
|
42
|
-
logger = logging.getLogger(__name__)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def get_test_file_path(file_name: str) -> str:
|
|
46
|
-
"""Return the path to a test file.
|
|
47
|
-
|
|
48
|
-
Parameters
|
|
49
|
-
----------
|
|
50
|
-
file_name
|
|
51
|
-
The name of the test file.
|
|
52
|
-
|
|
53
|
-
Returns
|
|
54
|
-
-------
|
|
55
|
-
str
|
|
56
|
-
The path to the test file.
|
|
57
|
-
|
|
58
|
-
Raises
|
|
59
|
-
------
|
|
60
|
-
FileNotFoundError
|
|
61
|
-
Raised if the file does not exist.
|
|
62
|
-
"""
|
|
63
|
-
file_path = os.path.join(TEST_DATA_DIR, file_name)
|
|
64
|
-
if not os.path.exists(file_path):
|
|
65
|
-
raise FileNotFoundError(file_path)
|
|
66
|
-
return file_path
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@contextmanager
|
|
70
|
-
def open_test_file(file_name: str) -> Iterator[IO[str]]:
|
|
71
|
-
"""Return a file object for a test file using a context manager.
|
|
72
|
-
|
|
73
|
-
Parameters
|
|
74
|
-
----------
|
|
75
|
-
file_name
|
|
76
|
-
The name of the test file.
|
|
77
|
-
|
|
78
|
-
Returns
|
|
79
|
-
-------
|
|
80
|
-
`Iterator` [ `IO` [ `str` ] ]
|
|
81
|
-
A file object for the test file.
|
|
82
|
-
|
|
83
|
-
Raises
|
|
84
|
-
------
|
|
85
|
-
FileNotFoundError
|
|
86
|
-
Raised if the file does not exist.
|
|
87
|
-
"""
|
|
88
|
-
logger.debug("Opening test file: %s", file_name)
|
|
89
|
-
file_path = get_test_file_path(file_name)
|
|
90
|
-
file = open(file_path)
|
|
91
|
-
try:
|
|
92
|
-
yield file
|
|
93
|
-
finally:
|
|
94
|
-
file.close()
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
def mk_temp_dir(parent_dir: str = TEST_TMP_DIR) -> str:
|
|
98
|
-
"""Create a temporary directory for testing.
|
|
99
|
-
|
|
100
|
-
Parameters
|
|
101
|
-
----------
|
|
102
|
-
parent_dir
|
|
103
|
-
The parent directory for the temporary directory.
|
|
104
|
-
|
|
105
|
-
Returns
|
|
106
|
-
-------
|
|
107
|
-
str
|
|
108
|
-
The path to the temporary directory.
|
|
109
|
-
"""
|
|
110
|
-
return tempfile.mkdtemp(dir=parent_dir)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def rm_temp_dir(temp_dir: str) -> None:
|
|
114
|
-
"""Remove a temporary directory.
|
|
115
|
-
|
|
116
|
-
Parameters
|
|
117
|
-
----------
|
|
118
|
-
temp_dir
|
|
119
|
-
The path to the temporary directory.
|
|
120
|
-
"""
|
|
121
|
-
logger.debug("Removing temporary directory: %s", temp_dir)
|
|
122
|
-
shutil.rmtree(temp_dir, ignore_errors=True)
|
felis/version.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
felis/__init__.py,sha256=THmRg3ylB4E73XhFjJX7YlnV_CM3lr_gZO_HqQFzIQ4,937
|
|
2
|
-
felis/cli.py,sha256=tHv4oqDVH0VtXVresY0irdVqZFgXrP-zhFgcO-LBRws,17315
|
|
3
|
-
felis/datamodel.py,sha256=3iZiNlCrOjJj87cCdTdRraUyx5o-Iwzh46aQ-dIwVDQ,35942
|
|
4
|
-
felis/metadata.py,sha256=MqNlBoFPMq18Kp0WUfyC8RtlxyBHTL_0SmHanAJgZWk,13698
|
|
5
|
-
felis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
felis/tap.py,sha256=76o8-ijmwgSE8UxMVn9KTlKrCPjG72LWyyAXO8yeqFE,21564
|
|
7
|
-
felis/tap_schema.py,sha256=cFZwW7lj0FiYa1BWtfX_Pbv9xi4jk0D-tp34h3jNs8E,22471
|
|
8
|
-
felis/types.py,sha256=m80GSGfNHQ3-NzRuTzKOyRXLJboPxdk9kzpp1SO8XdY,5510
|
|
9
|
-
felis/version.py,sha256=bVCmVS43pUKMl-xsU8K3PeQRVCJDeJlt6S8bWBo7Hr0,55
|
|
10
|
-
felis/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
felis/db/dialects.py,sha256=n5La-shu-8fHLIyf8rrazHDyrzATmMCdELtKV_0ymxI,3517
|
|
12
|
-
felis/db/sqltypes.py,sha256=JJy97U8KzAOg5pFi2xZgSjvU8CXXgrzkvCsmo6FLRG4,11060
|
|
13
|
-
felis/db/utils.py,sha256=SIl2ryOT2Zn5n0BqdNDxC1HcOoxh0doaKk_hMUGvwAc,14116
|
|
14
|
-
felis/db/variants.py,sha256=eahthrbVeV8ZdGamWQccNmWgx6CCscGrU0vQRs5HZK8,5260
|
|
15
|
-
felis/schemas/tap_schema_std.yaml,sha256=sPW-Vk72nY0PFpCvP5d8L8fWvhkif-x32sGtcfDZ8bU,7131
|
|
16
|
-
felis/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
felis/tests/postgresql.py,sha256=B_xk4fLual5-viGDqP20r94okuc0pbSvytRH_L0fvMs,4035
|
|
18
|
-
felis/tests/utils.py,sha256=YB7qQOXSaE3HTEjTBUqIqQx90LxGZjOZvZi2IPgoVhs,3247
|
|
19
|
-
lsst_felis-28.2024.4500.dist-info/COPYRIGHT,sha256=vJAFLFTSF1mhy9eIuA3P6R-3yxTWKQgpig88P-1IzRw,129
|
|
20
|
-
lsst_felis-28.2024.4500.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
21
|
-
lsst_felis-28.2024.4500.dist-info/METADATA,sha256=VOPFH2Czyt9X7JriYyv3LMus5e0g_nXSmubDG6GbLtY,1318
|
|
22
|
-
lsst_felis-28.2024.4500.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
23
|
-
lsst_felis-28.2024.4500.dist-info/entry_points.txt,sha256=Gk2XFujA_Gp52VBk45g5kim8TDoMDJFPctsMqiq72EM,40
|
|
24
|
-
lsst_felis-28.2024.4500.dist-info/top_level.txt,sha256=F4SvPip3iZRVyISi50CHhwTIAokAhSxjWiVcn4IVWRI,6
|
|
25
|
-
lsst_felis-28.2024.4500.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
26
|
-
lsst_felis-28.2024.4500.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -32,20 +32,20 @@ from sqlalchemy.dialects import mysql, postgresql
|
|
|
32
32
|
from sqlalchemy.ext.compiler import compiles
|
|
33
33
|
|
|
34
34
|
__all__ = [
|
|
35
|
+
"binary",
|
|
35
36
|
"boolean",
|
|
36
37
|
"byte",
|
|
37
|
-
"
|
|
38
|
+
"char",
|
|
39
|
+
"double",
|
|
40
|
+
"float",
|
|
41
|
+
"get_type_func",
|
|
38
42
|
"int",
|
|
39
43
|
"long",
|
|
40
|
-
"
|
|
41
|
-
"double",
|
|
42
|
-
"char",
|
|
44
|
+
"short",
|
|
43
45
|
"string",
|
|
44
|
-
"unicode",
|
|
45
46
|
"text",
|
|
46
|
-
"binary",
|
|
47
47
|
"timestamp",
|
|
48
|
-
"
|
|
48
|
+
"unicode",
|
|
49
49
|
]
|
|
50
50
|
|
|
51
51
|
MYSQL = "mysql"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|