datatailr 0.1.48__py3-none-any.whl → 0.1.49__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 datatailr might be problematic. Click here for more details.

@@ -85,11 +85,20 @@ def run_command_as_user(command: str | list, user: str, env_vars: dict):
85
85
  """
86
86
  Run a command as a specific user with the given environment variables.
87
87
  """
88
+ if os.path.isfile("/etc/python-site-location"):
89
+ with open("/etc/python-site-location") as f:
90
+ python_site = f.read().rstrip()
91
+ else:
92
+ # make this empty string once file creation is merged into build/Dockerfile
93
+ python_site = (
94
+ "/opt/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/site-packages"
95
+ )
96
+
88
97
  if isinstance(command, list):
89
98
  command = " ".join(command)
90
99
  env_vars = {
91
100
  "PATH": get_env_var("PATH", ""),
92
- "PYTHONPATH": get_env_var("PYTHONPATH", ""),
101
+ "PYTHONPATH": get_env_var("PYTHONPATH", "") + ":" + python_site,
93
102
  } | env_vars
94
103
 
95
104
  env_kv = [f"{k}={v}" for k, v in env_vars.items()]
@@ -13,7 +13,8 @@
13
13
  import os
14
14
  import sys
15
15
  import runpy
16
- from importlib.resources import files
16
+ import inspect
17
+ import importlib
17
18
 
18
19
  from datatailr.logging import DatatailrLogger
19
20
 
@@ -29,9 +30,12 @@ def run():
29
30
  "Environment variable 'DATATAILR_ENTRYPOINT' is not in the format 'module_name:file_name'."
30
31
  )
31
32
 
32
- module_name, file_name = entrypoint.split(":")
33
+ module_name, func_name = entrypoint.split(":")
33
34
 
34
- script = files(module_name).joinpath(file_name)
35
+ # consider using ast
36
+ module = importlib.import_module(module_name)
37
+ function = getattr(module, func_name)
38
+ script = inspect.getfile(function)
35
39
  sys.argv = ["streamlit", "run", str(script), *sys.argv[1:]]
36
40
  logger.info(f"Running entrypoint: {entrypoint}")
37
41
  runpy.run_module("streamlit", run_name="__main__")
@@ -115,11 +115,10 @@ class ArgumentsCache:
115
115
  :param job: Name of the job.
116
116
  :param result: Result of the batch job.
117
117
  """
118
- path = f"/tmp/datatailr/batch/results/{batch_run_id}/{job}.pkl"
118
+ path = f"/tmp/datatailr/batch/results/{batch_run_id}_{job}.pkl"
119
119
  if self.use_persistent_cache and isinstance(job, str):
120
120
  self._add_to_persistent_cache(path, result)
121
121
  else:
122
- os.makedirs(os.path.dirname(path), exist_ok=True)
123
122
  with open(path, "wb") as f:
124
123
  pickle.dump(result, f)
125
124
 
@@ -131,7 +130,7 @@ class ArgumentsCache:
131
130
  :param job: Name of the job.
132
131
  :return: Result of the batch job.
133
132
  """
134
- path = f"/tmp/datatailr/batch/results/{batch_run_id}/{job}.pkl"
133
+ path = f"/tmp/datatailr/batch/results/{batch_run_id}_{job}.pkl"
135
134
  if self.use_persistent_cache and isinstance(job, str):
136
135
  return self._get_from_persistent_cache(path)
137
136
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datatailr
3
- Version: 0.1.48
3
+ Version: 0.1.49
4
4
  Summary: Ready-to-Use Platform That Drives Business Insights
5
5
  Author-email: Datatailr <info@datatailr.com>
6
6
  License-Expression: MIT
@@ -12,22 +12,22 @@ datatailr/version.py,sha256=N9K8ZxlwFFSz8XSgbgaTWZY4k2J0JKfj698nZ_O2pIU,536
12
12
  datatailr/wrapper.py,sha256=K9ZD76cWey_ikA6C5sKejwRaYBDln4QMg-RcoRGiuFc,7991
13
13
  datatailr/build/__init__.py,sha256=_dA7b4L6wsaAFaSxUoYSJ1oaRqDHDMR20kqoCocSOss,487
14
14
  datatailr/build/image.py,sha256=YC8ML-l-sj6TcIBY-DCx_vaeI_7SmL9fPFhHnuxzRh0,5509
15
- datatailr/sbin/datatailr_run.py,sha256=z34l28CH8YTwQGusmJXlzgOtslOqL_whqeMzjEAZ3TA,6895
16
- datatailr/sbin/datatailr_run_app.py,sha256=AOkutzv4DeKfWZs-ZBciAMKnK4A05SfkVf1ZJnSSFwA,1231
15
+ datatailr/sbin/datatailr_run.py,sha256=jgMBIRLYTcCdvSIe77wrdf8XIbadn0hE0REs8sMc6dY,7274
16
+ datatailr/sbin/datatailr_run_app.py,sha256=pYiofYG13R6YIiN81n7MNn5_mLdZM9vuFJH-RjdvtRM,1329
17
17
  datatailr/sbin/datatailr_run_batch.py,sha256=UWnp96j_G66R_Cape7Bb-rbK6UBLF7Y5_mTlWyGJAVQ,1818
18
18
  datatailr/sbin/datatailr_run_excel.py,sha256=MY2XH-T5bWABR23C_15eLhjaxggGRgjRhA-ByS6CtMc,1422
19
19
  datatailr/sbin/datatailr_run_service.py,sha256=R8eNLN2SGnMtyfLy3vq9isUHr3dRzeBqESTquNK9Iho,1156
20
20
  datatailr/scheduler/__init__.py,sha256=qydHYVtEP6SUWd2CQ6FRdTdRWNz3SbYPJy4FK_wOvMk,1772
21
- datatailr/scheduler/arguments_cache.py,sha256=dl8IG9RTLSrJUk6g0_LYolkcuqW-LF52wdLPhs07LRI,6076
21
+ datatailr/scheduler/arguments_cache.py,sha256=3sKXg4_baeZNo8jvSGTFK6zT5RM1TKMpH-UVS1CLn20,6014
22
22
  datatailr/scheduler/base.py,sha256=pkLKhPS_CfgGMCb3Qqskg7JVQMLUe0hEFAcVhMj3jts,15108
23
23
  datatailr/scheduler/batch.py,sha256=-dRfHosZy1YWhKlrNZWtxA7tJ7MHvAm-NFen5mFxpUI,17604
24
24
  datatailr/scheduler/batch_decorator.py,sha256=LqL1bsupWLn-YEQUvFJYae7R3ogrL5-VodyiiScrkRw,5806
25
25
  datatailr/scheduler/constants.py,sha256=5WWTsfwZ_BA8gVDOTa2AQX9DJ0NzfaWgtY3vrODS2-8,606
26
26
  datatailr/scheduler/schedule.py,sha256=0XJJen2nL1xplRs0Xbjwgq3T-0bFCOrJzkSALdio998,3741
27
27
  datatailr/scheduler/utils.py,sha256=up6oR2iwe6G52LkvgfO394xchXgCYNjOMGRQW3e8PQk,1082
28
- datatailr-0.1.48.dist-info/licenses/LICENSE,sha256=ikKP4_O-UD_b8FuNdKmbzTb6odd0JX085ZW_FAPN3VI,1066
29
- datatailr-0.1.48.dist-info/METADATA,sha256=Y2UspGjKCTg09y8JkTppwCOjZ1k3CvP6vjAhdLtqJwc,5146
30
- datatailr-0.1.48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- datatailr-0.1.48.dist-info/entry_points.txt,sha256=YqXfk2At-olW4PUSRkqvy_O3Mbv7uTKCCPuAAiz3Qbg,312
32
- datatailr-0.1.48.dist-info/top_level.txt,sha256=75gntW0X_SKpqxLL6hAPipvpk28GAhJBvoyqN_HohWU,10
33
- datatailr-0.1.48.dist-info/RECORD,,
28
+ datatailr-0.1.49.dist-info/licenses/LICENSE,sha256=ikKP4_O-UD_b8FuNdKmbzTb6odd0JX085ZW_FAPN3VI,1066
29
+ datatailr-0.1.49.dist-info/METADATA,sha256=BcUo34as2Gig3d9sFeqCEZwXSJ7tH5E8KxaNytJfqQI,5146
30
+ datatailr-0.1.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ datatailr-0.1.49.dist-info/entry_points.txt,sha256=YqXfk2At-olW4PUSRkqvy_O3Mbv7uTKCCPuAAiz3Qbg,312
32
+ datatailr-0.1.49.dist-info/top_level.txt,sha256=75gntW0X_SKpqxLL6hAPipvpk28GAhJBvoyqN_HohWU,10
33
+ datatailr-0.1.49.dist-info/RECORD,,