dataflow-core 2.1.13__tar.gz → 2.1.14rc1__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 dataflow-core might be problematic. Click here for more details.
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/PKG-INFO +1 -1
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/dataflowairflowauthenticator.py +9 -3
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/dataflow.py +34 -7
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/variables.py +9 -2
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/PKG-INFO +1 -1
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/setup.py +1 -1
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/README.md +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/dataflowhubauthenticator.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/dataflowsupersetauthenticator.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/configuration.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/database_manager.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/db.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/environment.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/app_types.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/blacklist_library.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/connection.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/dataflow_zone.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/environment.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/environment_status.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/git_ssh.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/pinned_projects.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/pod_activity.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/pod_session_history.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/project_details.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/recent_project_studio.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/recent_projects.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/role.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/role_server.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/role_zone.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/server_config.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/session.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/team.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/user.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/user_environment.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/models/user_team.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/schemas/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/schemas/connection.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/schemas/git_ssh.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/schemas/secret.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/scripts/clone_environment.sh +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/scripts/create_environment.sh +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/scripts/update_environment.sh +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/factory.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/interface.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/aws_manager.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/azure_manager.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/service.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/utils/__init__.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/utils/exceptions.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/utils/get_current_user.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/utils/logger.py +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/SOURCES.txt +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/dependency_links.txt +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/entry_points.txt +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/requires.txt +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/top_level.txt +0 -0
- {dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/setup.cfg +0 -0
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/dataflowairflowauthenticator.py
RENAMED
|
@@ -4,7 +4,7 @@ from flask_appbuilder.security.views import expose
|
|
|
4
4
|
from flask_login import login_user
|
|
5
5
|
from airflow.www.security import FabAirflowSecurityManagerOverride
|
|
6
6
|
from dataflow.dataflow import Dataflow
|
|
7
|
-
import logging
|
|
7
|
+
import logging, os
|
|
8
8
|
|
|
9
9
|
logging.basicConfig(
|
|
10
10
|
level=logging.INFO,
|
|
@@ -29,9 +29,15 @@ class DataflowAuthDBView(AuthDBView):
|
|
|
29
29
|
|
|
30
30
|
user_details = dataflow.auth(session_id)
|
|
31
31
|
logger.info(f"User details retrieved for: {user_details['user_name']}")
|
|
32
|
+
if os.getenv("RUNTIME"):
|
|
33
|
+
role = self.appbuilder.sm.find_role(user_details.get("base_role", "user").title())
|
|
34
|
+
else:
|
|
35
|
+
role = self.appbuilder.sm.find_role("Admin")
|
|
32
36
|
user = self.appbuilder.sm.find_user(username=user_details['user_name'])
|
|
33
37
|
if user:
|
|
34
|
-
|
|
38
|
+
# Update user role
|
|
39
|
+
user.role = role
|
|
40
|
+
self.appbuilder.sm.update_user(user=user)
|
|
35
41
|
login_user(user, remember=False)
|
|
36
42
|
else:
|
|
37
43
|
user = self.appbuilder.sm.add_user(
|
|
@@ -39,7 +45,7 @@ class DataflowAuthDBView(AuthDBView):
|
|
|
39
45
|
first_name=user_details.get("first_name", ""),
|
|
40
46
|
last_name=user_details.get("last_name", ""),
|
|
41
47
|
email=user_details.get("email", ""),
|
|
42
|
-
role=
|
|
48
|
+
role=role,
|
|
43
49
|
)
|
|
44
50
|
logger.info(f"New user created: {user}")
|
|
45
51
|
if user:
|
|
@@ -8,6 +8,34 @@ class Dataflow:
|
|
|
8
8
|
"""
|
|
9
9
|
Dataflow class to interact with Dataflow services.
|
|
10
10
|
"""
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def _json_parse(value):
|
|
14
|
+
try:
|
|
15
|
+
result = json.loads(value)
|
|
16
|
+
if isinstance(result, str):
|
|
17
|
+
try:
|
|
18
|
+
return json.loads(result)
|
|
19
|
+
except json.JSONDecodeError:
|
|
20
|
+
return result
|
|
21
|
+
return result
|
|
22
|
+
except (json.JSONDecodeError, TypeError):
|
|
23
|
+
return value
|
|
24
|
+
|
|
25
|
+
def _parse_response_data(self, response):
|
|
26
|
+
"""Parse response data based on datatype field or fallback to JSON parsing."""
|
|
27
|
+
data = response.json()
|
|
28
|
+
value = data.get('value', '')
|
|
29
|
+
if isinstance(data, dict) and 'datatype' in data:
|
|
30
|
+
value = data.get('value', '')
|
|
31
|
+
datatype = data.get('datatype')
|
|
32
|
+
if datatype == 'json':
|
|
33
|
+
return self._json_parse(value)
|
|
34
|
+
else:
|
|
35
|
+
return value
|
|
36
|
+
else:
|
|
37
|
+
return self._json_parse(value)
|
|
38
|
+
|
|
11
39
|
def auth(self, session_id: str):
|
|
12
40
|
"""
|
|
13
41
|
Retrieve and return user information using their session ID.
|
|
@@ -41,7 +69,7 @@ class Dataflow:
|
|
|
41
69
|
|
|
42
70
|
except Exception as e:
|
|
43
71
|
return e
|
|
44
|
-
|
|
72
|
+
|
|
45
73
|
def variable(self, variable_name: str):
|
|
46
74
|
"""
|
|
47
75
|
Retrieve a Dataflow variable.
|
|
@@ -106,9 +134,9 @@ class Dataflow:
|
|
|
106
134
|
elif response.status_code != 200:
|
|
107
135
|
print(f"[Dataflow.variable] Unexpected status {response.status_code} for variable '{variable_name}'")
|
|
108
136
|
return None
|
|
137
|
+
|
|
138
|
+
return self._parse_response_data(response)
|
|
109
139
|
|
|
110
|
-
return response.text.strip().strip('"')
|
|
111
|
-
|
|
112
140
|
except requests.exceptions.RequestException as e:
|
|
113
141
|
raise RuntimeError(f"[Dataflow.variable] Failed to fetch variable '{variable_name}'") from e
|
|
114
142
|
|
|
@@ -163,8 +191,8 @@ class Dataflow:
|
|
|
163
191
|
print(f"[Dataflow.secret] Unexpected status {response.status_code} for secret '{secret_name}'")
|
|
164
192
|
return None
|
|
165
193
|
|
|
166
|
-
return
|
|
167
|
-
|
|
194
|
+
return self._parse_response_data(response)
|
|
195
|
+
|
|
168
196
|
except requests.exceptions.RequestException as e:
|
|
169
197
|
raise RuntimeError(f"[Dataflow.secret] Failed to fetch secret '{secret_name}'") from e
|
|
170
198
|
except Exception as e:
|
|
@@ -313,8 +341,7 @@ class Dataflow:
|
|
|
313
341
|
print(f"[Dataflow.variable_or_secret] Unexpected status {response.status_code} for key '{key}'")
|
|
314
342
|
return None
|
|
315
343
|
|
|
316
|
-
|
|
317
|
-
return response_text
|
|
344
|
+
return self._parse_response_data(response)
|
|
318
345
|
|
|
319
346
|
except requests.exceptions.RequestException as e:
|
|
320
347
|
raise RuntimeError(f"[Dataflow.variable_or_secret] Failed to fetch '{key}'") from e
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
from sqlalchemy import Column, Integer, String, ForeignKey, Text, DateTime, func, UniqueConstraint, CheckConstraint, Boolean
|
|
1
|
+
from sqlalchemy import Column, Integer, String, ForeignKey, Text, DateTime, func, UniqueConstraint, CheckConstraint, Boolean, Enum
|
|
2
2
|
from dataflow.db import Base
|
|
3
|
+
import enum
|
|
3
4
|
|
|
5
|
+
class DataType(str, enum.Enum):
|
|
6
|
+
raw = "raw"
|
|
7
|
+
json = "json"
|
|
8
|
+
file = "file"
|
|
4
9
|
class Variable(Base):
|
|
5
10
|
"""
|
|
6
11
|
Unified VARIABLE table to support both Studio and Runtime environments.
|
|
@@ -13,13 +18,15 @@ class Variable(Base):
|
|
|
13
18
|
value = Column(Text, nullable=False)
|
|
14
19
|
type = Column(String, nullable=False)
|
|
15
20
|
description = Column(Text, nullable=True)
|
|
21
|
+
filename = Column(String, nullable=True)
|
|
16
22
|
runtime = Column(String, nullable=True)
|
|
17
23
|
slug = Column(String, nullable=True)
|
|
18
24
|
created_at = Column(DateTime, server_default=func.now())
|
|
19
25
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
|
20
26
|
created_by = Column(String, ForeignKey('USER.user_name'), nullable=True)
|
|
21
27
|
is_active = Column(Boolean, default=True, nullable=False)
|
|
22
|
-
|
|
28
|
+
datatype = Column(Enum(DataType, name="data_type"), nullable=False)
|
|
29
|
+
set_as_env = Column(Boolean, default=False, nullable=False)
|
|
23
30
|
|
|
24
31
|
__table_args__ = (
|
|
25
32
|
CheckConstraint(type.in_(['variable', 'secret']), name='check_variable_type'),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/authenticator/dataflowsupersetauthenticator.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/__init__.py
RENAMED
|
File without changes
|
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/aws_manager.py
RENAMED
|
File without changes
|
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow/secrets_manager/providers/azure_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataflow_core-2.1.13 → dataflow_core-2.1.14rc1}/dataflow_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|