Rifqi Hafizuddin commited on
Commit ·
52415b6
1
Parent(s): b145c06
[NOTICKET] minor code refactor
Browse files
src/config/settings.py
CHANGED
|
@@ -63,7 +63,7 @@ class Settings(BaseSettings):
|
|
| 63 |
|
| 64 |
# DB credential encryption (Fernet key for user-registered database creds)
|
| 65 |
dataeyond_db_credential_key: str = Field(
|
| 66 |
-
alias="dataeyond__db__credential__key"
|
| 67 |
)
|
| 68 |
|
| 69 |
|
|
|
|
| 63 |
|
| 64 |
# DB credential encryption (Fernet key for user-registered database creds)
|
| 65 |
dataeyond_db_credential_key: str = Field(
|
| 66 |
+
alias="dataeyond__db__credential__key"
|
| 67 |
)
|
| 68 |
|
| 69 |
|
src/pipeline/db_pipeline/db_pipeline_service.py
CHANGED
|
@@ -128,7 +128,7 @@ class DbPipelineService:
|
|
| 128 |
)
|
| 129 |
return create_engine(url)
|
| 130 |
|
| 131 |
-
raise
|
| 132 |
|
| 133 |
@contextmanager
|
| 134 |
def engine_scope(
|
|
|
|
| 128 |
)
|
| 129 |
return create_engine(url)
|
| 130 |
|
| 131 |
+
raise NotImplementedError(f"Unsupported db_type: {db_type}")
|
| 132 |
|
| 133 |
@contextmanager
|
| 134 |
def engine_scope(
|
src/pipeline/db_pipeline/extractor.py
CHANGED
|
@@ -149,10 +149,10 @@ def profile_column(
|
|
| 149 |
order_by="ORDER BY cnt DESC",
|
| 150 |
)
|
| 151 |
top = pd.read_sql(top_sql, engine)
|
| 152 |
-
profile["top_values"] = list(zip(top[
|
| 153 |
|
| 154 |
sample = pd.read_sql(_head_query(engine, qc, qt, 5), engine)
|
| 155 |
-
profile["sample_values"] = sample[
|
| 156 |
|
| 157 |
return profile
|
| 158 |
|
|
|
|
| 149 |
order_by="ORDER BY cnt DESC",
|
| 150 |
)
|
| 151 |
top = pd.read_sql(top_sql, engine)
|
| 152 |
+
profile["top_values"] = list(zip(top.iloc[:, 0].tolist(), top["cnt"].tolist()))
|
| 153 |
|
| 154 |
sample = pd.read_sql(_head_query(engine, qc, qt, 5), engine)
|
| 155 |
+
profile["sample_values"] = sample.iloc[:, 0].tolist()
|
| 156 |
|
| 157 |
return profile
|
| 158 |
|