datatailr 0.1.22__tar.gz → 0.1.24__tar.gz
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 datatailr might be problematic. Click here for more details.
- {datatailr-0.1.22/src/datatailr.egg-info → datatailr-0.1.24}/PKG-INFO +1 -1
- {datatailr-0.1.22 → datatailr-0.1.24}/pyproject.toml +1 -1
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/arguments_cache.py +0 -10
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/base.py +13 -6
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/user.py +3 -1
- {datatailr-0.1.22 → datatailr-0.1.24/src/datatailr.egg-info}/PKG-INFO +1 -1
- {datatailr-0.1.22 → datatailr-0.1.24}/src/sbin/datatailr_run.py +5 -1
- {datatailr-0.1.22 → datatailr-0.1.24}/LICENSE +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/README.md +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/setup.cfg +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/setup.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/__init__.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/acl.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/blob.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/build/__init__.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/build/image.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/dt_json.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/errors.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/excel.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/group.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/logging.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/__init__.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/batch.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/batch_decorator.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/constants.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/schedule.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/scheduler/utils.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/utils.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/version.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr/wrapper.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr.egg-info/SOURCES.txt +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr.egg-info/dependency_links.txt +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr.egg-info/entry_points.txt +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr.egg-info/requires.txt +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/datatailr.egg-info/top_level.txt +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/sbin/datatailr_run_app.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/sbin/datatailr_run_batch.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/sbin/datatailr_run_excel.py +0 -0
- {datatailr-0.1.22 → datatailr-0.1.24}/src/sbin/datatailr_run_service.py +0 -0
|
@@ -28,11 +28,9 @@ from typing import Any, Dict, Optional
|
|
|
28
28
|
|
|
29
29
|
from datatailr import is_dt_installed, Blob
|
|
30
30
|
from datatailr.errors import DatatailrError
|
|
31
|
-
from datatailr.logging import DatatailrLogger
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
__BLOB_STORAGE__ = Blob()
|
|
35
|
-
logger = DatatailrLogger(__name__).get_logger()
|
|
36
34
|
|
|
37
35
|
|
|
38
36
|
class CacheNotFoundError(DatatailrError):
|
|
@@ -81,9 +79,6 @@ class ArgumentsCache:
|
|
|
81
79
|
:param job_name: Name of the job.
|
|
82
80
|
:return: Dictionary of arguments.
|
|
83
81
|
"""
|
|
84
|
-
logger.info(
|
|
85
|
-
f"Retrieving arguments for {batch_id=}, {job=}, {batch_run_id=}, {self.use_persistent_cache=}"
|
|
86
|
-
)
|
|
87
82
|
path = f"/tmp/datatailr/batch/arguments/{batch_id}.pkl"
|
|
88
83
|
if self.use_persistent_cache and isinstance(job, str):
|
|
89
84
|
try:
|
|
@@ -121,9 +116,6 @@ class ArgumentsCache:
|
|
|
121
116
|
:param result: Result of the batch job.
|
|
122
117
|
"""
|
|
123
118
|
path = f"/tmp/datatailr/batch/results/{batch_run_id}_{job}.pkl"
|
|
124
|
-
logger.info(
|
|
125
|
-
f"Adding result for {batch_run_id=}, {job=}, {result=}, {self.use_persistent_cache=}"
|
|
126
|
-
)
|
|
127
119
|
if self.use_persistent_cache and isinstance(job, str):
|
|
128
120
|
self._add_to_persistent_cache(path, result)
|
|
129
121
|
else:
|
|
@@ -160,7 +152,6 @@ class ArgumentsCache:
|
|
|
160
152
|
|
|
161
153
|
"""
|
|
162
154
|
path = path.replace("/tmp/", "")
|
|
163
|
-
logger.info(f"Adding arguments to persistent cache for {path=}")
|
|
164
155
|
__BLOB_STORAGE__.put_blob(path, json.dumps(blob))
|
|
165
156
|
|
|
166
157
|
def _get_from_persistent_cache(self, path: str) -> Any:
|
|
@@ -170,6 +161,5 @@ class ArgumentsCache:
|
|
|
170
161
|
:param path: Path in the Blob storage where the blob is stored.
|
|
171
162
|
"""
|
|
172
163
|
path = path.replace("/tmp/", "")
|
|
173
|
-
logger.info(f"Retrieving arguments from persistent cache for {path=}")
|
|
174
164
|
data = __BLOB_STORAGE__.get_blob(path)
|
|
175
165
|
return json.loads(data)
|
|
@@ -96,13 +96,20 @@ class EntryPoint:
|
|
|
96
96
|
# Find the absolute path to the repository and then the relative path to the module.
|
|
97
97
|
# This will be used in the creation of the code 'bundle' when building the image.
|
|
98
98
|
module_spec = importlib.util.find_spec(func.__module__)
|
|
99
|
-
if
|
|
100
|
-
|
|
99
|
+
if not module_spec:
|
|
100
|
+
raise RepoValidationError(f"Cannot find spec for {self.module_name}")
|
|
101
|
+
# Resolve the filesystem directory of the top package for module_name
|
|
102
|
+
if module_spec.submodule_search_locations:
|
|
103
|
+
# It's a package; get its directory
|
|
104
|
+
package_root = os.path.abspath(
|
|
105
|
+
next(iter(module_spec.submodule_search_locations))
|
|
106
|
+
)
|
|
107
|
+
elif module_spec.origin:
|
|
108
|
+
# It's a module; use its containing directory
|
|
109
|
+
package_root = os.path.abspath(os.path.dirname(module_spec.origin))
|
|
101
110
|
else:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
for _ in module_parts:
|
|
105
|
-
package_root = os.path.dirname(package_root)
|
|
111
|
+
raise RepoValidationError(f"Cannot resolve path for {self.module_name}")
|
|
112
|
+
|
|
106
113
|
path_to_repo = run_shell_command(
|
|
107
114
|
f"cd {package_root} && git rev-parse --show-toplevel"
|
|
108
115
|
)[0]
|
|
@@ -177,6 +177,7 @@ class User:
|
|
|
177
177
|
email=email,
|
|
178
178
|
primary_group=primary_group,
|
|
179
179
|
system=is_system_user,
|
|
180
|
+
json_enrichened=True,
|
|
180
181
|
)
|
|
181
182
|
else:
|
|
182
183
|
new_user = __client__.add(
|
|
@@ -187,9 +188,10 @@ class User:
|
|
|
187
188
|
password=password,
|
|
188
189
|
primary_group=primary_group,
|
|
189
190
|
system=is_system_user,
|
|
191
|
+
json_enrichened=True,
|
|
190
192
|
)
|
|
191
193
|
|
|
192
|
-
return new_user
|
|
194
|
+
return User(new_user["name"]) if new_user else None
|
|
193
195
|
|
|
194
196
|
@staticmethod
|
|
195
197
|
def exists(name: str) -> bool:
|
|
@@ -36,10 +36,14 @@ import os
|
|
|
36
36
|
import sys
|
|
37
37
|
from typing import Tuple
|
|
38
38
|
from datatailr.logging import DatatailrLogger
|
|
39
|
-
|
|
39
|
+
from datatailr.utils import is_dt_installed
|
|
40
40
|
|
|
41
41
|
logger = DatatailrLogger(os.path.abspath(__file__)).get_logger()
|
|
42
42
|
|
|
43
|
+
if not is_dt_installed():
|
|
44
|
+
logger.error("Datatailr is not installed.")
|
|
45
|
+
sys.exit(1)
|
|
46
|
+
|
|
43
47
|
|
|
44
48
|
def get_env_var(name: str, default: str | None = None) -> str:
|
|
45
49
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|