Upload 108 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .ipynb_checkpoints/Untitled-checkpoint.ipynb +6 -0
- backup/1DATA CATALOG.py +221 -0
- backup/DATA CATALOG.py +121 -0
- data/1714740977.8544624-gemini_messages +0 -0
- data/1714740977.8544624-st_messages +0 -0
- data/1714983684.3830516-gemini_messages +1 -0
- data/1714983684.3830516-st_messages +0 -0
- data/1715077374.7732036-gemini_messages +1 -0
- data/1715077374.7732036-st_messages +0 -0
- data/1715077982.0880668-gemini_messages +1 -0
- data/1715077982.0880668-st_messages +0 -0
- data/1715078619.2998087-gemini_messages +1 -0
- data/1715078619.2998087-st_messages +0 -0
- data/1715082116.767178-gemini_messages +0 -0
- data/1715082116.767178-st_messages +0 -0
- data/1715086623.645372-gemini_messages +0 -0
- data/1715086623.645372-st_messages +0 -0
- data/1715103041.8389978-gemini_messages +0 -0
- data/1715103041.8389978-st_messages +0 -0
- data/1715249415.4287577-gemini_messages +0 -0
- data/1715249415.4287577-st_messages +0 -0
- data/1717564238.3270795-gemini_messages +0 -0
- data/1717564238.3270795-st_messages +0 -0
- data/1717579231.916155-gemini_messages +0 -0
- data/1717579231.916155-st_messages +0 -0
- data/1717580421.5748234-gemini_messages +0 -0
- data/1717580421.5748234-st_messages +0 -0
- data/1717672759.119191-gemini_messages +0 -0
- data/1717672759.119191-st_messages +0 -0
- data/1718020955.6171474-gemini_messages +0 -0
- data/1718020955.6171474-st_messages +0 -0
- data/1718025984.855813-gemini_messages +0 -0
- data/1718025984.855813-st_messages +0 -0
- data/1718101291.9514854-gemini_messages +0 -0
- data/1718101291.9514854-st_messages +0 -0
- data/1718212497.2504222-gemini_messages +0 -0
- data/1718212497.2504222-st_messages +0 -0
- data/1718255487.3908408-gemini_messages +0 -0
- data/1718255487.3908408-st_messages +0 -0
- data/1718276733.3224595-gemini_messages +0 -0
- data/1718276733.3224595-st_messages +0 -0
- data/1718278412.7311835-gemini_messages +0 -0
- data/1718278412.7311835-st_messages +0 -0
- data/1718360522.2414901-gemini_messages +0 -0
- data/1718360522.2414901-st_messages +0 -0
- data/1718361823.6470416-gemini_messages +0 -0
- data/1718361823.6470416-st_messages +0 -0
- data/1718709779.1290016-gemini_messages +0 -0
- data/1718709779.1290016-st_messages +0 -0
- data/1718715582.2066972-gemini_messages +0 -0
.ipynb_checkpoints/Untitled-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
backup/1DATA CATALOG.py
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import numpy as np
|
3 |
+
import streamlit as st
|
4 |
+
import sdv
|
5 |
+
from sdv.datasets.local import load_csvs
|
6 |
+
from sdv.metadata import MultiTableMetadata
|
7 |
+
from sdv.multi_table import HMASynthesizer
|
8 |
+
import time
|
9 |
+
import os
|
10 |
+
import gc
|
11 |
+
import warnings
|
12 |
+
from PIL import Image
|
13 |
+
from sdv.metadata import SingleTableMetadata
|
14 |
+
import pyodbc
|
15 |
+
import google.generativeai as genai
|
16 |
+
import textwrap
|
17 |
+
from streamlit_extras.stylable_container import stylable_container
|
18 |
+
genai.configure(api_key='AIzaSyDgS-r-wKmJJ6g2SawaV8ULa-DpTvRjBa0')
|
19 |
+
genai_mod = genai.GenerativeModel(
|
20 |
+
model_name='models/gemini-1.5-pro-latest'
|
21 |
+
)
|
22 |
+
|
23 |
+
st.set_page_config(page_title='DATA DISCOVERY')
|
24 |
+
st.title('AUTOMATED DATA CATALOGUE')
|
25 |
+
st.subheader('SELECT SOURCE')
|
26 |
+
select1=st.selectbox('SOURCE NAME',('DB_10001','Marcopolo_db'),key='dbname',index=None,placeholder='Select database name')
|
27 |
+
if select1 =='DB_10001':
|
28 |
+
datasets = load_csvs(
|
29 |
+
folder_name='C:\Applications\MARCO POLO O AIML\DATA CATALOG\BIKE_STORE_DATABASE',
|
30 |
+
read_csv_parameters={
|
31 |
+
'skipinitialspace': True,
|
32 |
+
'encoding': 'utf_8'
|
33 |
+
})
|
34 |
+
st.markdown(f"System has found :orange[**{str(len(datasets))} tables**] in the source. Please proceed with selection of mode of discovery.")
|
35 |
+
select_main = st.selectbox('Please Select Mode of Discovery',('Single Table Discovery','Multi Table Discovery'),key='mainname',index=None,placeholder='Select Mode of Discovery')
|
36 |
+
if select_main == 'Multi Table Discovery':
|
37 |
+
with st.spinner('Performing Data Discovery'):
|
38 |
+
time.sleep(2)
|
39 |
+
st.success('Data cataloguing complete!')
|
40 |
+
datasets = load_csvs(
|
41 |
+
folder_name='C:\Applications\MARCO POLO O AIML\DATA CATALOG\BIKE_STORE_DATABASE',
|
42 |
+
read_csv_parameters={
|
43 |
+
'skipinitialspace': True,
|
44 |
+
'encoding': 'utf_8'
|
45 |
+
})
|
46 |
+
metadata = MultiTableMetadata()
|
47 |
+
metadata.detect_from_csvs(folder_name='C:\Applications\MARCO POLO O AIML\DATA CATALOG\BIKE_STORE_DATABASE')
|
48 |
+
python_dict = metadata.to_dict()
|
49 |
+
st.markdown('---')
|
50 |
+
st.subheader('DATA CATALOG')
|
51 |
+
# st.json(python_dict)
|
52 |
+
brands=datasets['brands']
|
53 |
+
categories=datasets['categories']
|
54 |
+
customers=datasets['CUSTOMER_MASTER_TBL_1']
|
55 |
+
orderitems=datasets['order_items']
|
56 |
+
orders=datasets['orders']
|
57 |
+
products=datasets['products']
|
58 |
+
staffs=datasets['staffs']
|
59 |
+
stocks=datasets['stocks']
|
60 |
+
stores=datasets['stores']
|
61 |
+
tables=python_dict['tables']
|
62 |
+
table_names=[*tables]
|
63 |
+
col1, col2, col3 = st.columns([2,2,2])
|
64 |
+
|
65 |
+
with col1:
|
66 |
+
def view_callback():
|
67 |
+
st.session_state.tdet = False
|
68 |
+
view= st.button("LIST TABLES",key='view',on_click=view_callback)
|
69 |
+
with col2:
|
70 |
+
if 'tdet' not in st.session_state:
|
71 |
+
st.session_state.tdet = False
|
72 |
+
tdet1 = st.button("SHOW TABLE DETAILS")
|
73 |
+
with col3:
|
74 |
+
rel=st.button('SHOW RELATIONSHIPS',key='rel',on_click=view_callback)
|
75 |
+
|
76 |
+
if tdet1:
|
77 |
+
st.session_state.tdet = tdet1
|
78 |
+
if view:
|
79 |
+
#st.write(python_dict)
|
80 |
+
|
81 |
+
st.write(pd.DataFrame(table_names,columns=['TABLE NAME']))
|
82 |
+
|
83 |
+
if rel:
|
84 |
+
rlist1=python_dict['relationships']
|
85 |
+
rdf=pd.DataFrame(columns=['PARENT TABLE','CHILD TABLE','PARENT PRIMARY KEY','CHILD FOREIGN KEY'])
|
86 |
+
for i in range(len(rlist1)):
|
87 |
+
rlist=rlist1[i]
|
88 |
+
nrow=pd.DataFrame({'PARENT TABLE':rlist['parent_table_name'],'CHILD TABLE':rlist['child_table_name'],'PARENT PRIMARY KEY':rlist['parent_primary_key'],'CHILD FOREIGN KEY':rlist['child_foreign_key']},index=[i])
|
89 |
+
rdf=pd.concat([rdf,nrow],ignore_index=True)
|
90 |
+
st.write(rdf)
|
91 |
+
if st.session_state.tdet is True:
|
92 |
+
def tdet_callback():
|
93 |
+
st.session_state.tdet=True
|
94 |
+
st.subheader('Select table name to view')
|
95 |
+
sbox1=st.selectbox('TABLE NAME',table_names,index=None,placeholder='Select table name',on_change=tdet_callback)
|
96 |
+
col4, col5 = st.columns([1, 3])
|
97 |
+
with col4:
|
98 |
+
preview= st.button("PREVIEW TABLE",key='preview')
|
99 |
+
with col5:
|
100 |
+
cdet = st.button("GET COLUMN DETAILS",key='prof')
|
101 |
+
if preview:
|
102 |
+
st.write(datasets[sbox1])
|
103 |
+
if cdet:
|
104 |
+
cdetails=pd.DataFrame(columns=['Column Name','Data Type','Personal Identifiable Information'])
|
105 |
+
t_dict=tables[sbox1]
|
106 |
+
c_dict=t_dict['columns']
|
107 |
+
i=0
|
108 |
+
for key in c_dict:
|
109 |
+
e_dict=c_dict[key]
|
110 |
+
if 'pii' in e_dict:
|
111 |
+
p='YES'
|
112 |
+
else:
|
113 |
+
p='NO'
|
114 |
+
if e_dict['sdtype']=='datetime':
|
115 |
+
v=e_dict['sdtype']+': '+e_dict['datetime_format']
|
116 |
+
else:
|
117 |
+
v=e_dict['sdtype']
|
118 |
+
new_row=pd.DataFrame({'Column Name':key,'Data Type':v,'Personal Identifiable Information':p},index=[i])
|
119 |
+
cdetails=pd.concat([cdetails, new_row],ignore_index=True)
|
120 |
+
i=i+1
|
121 |
+
if 'primary_key' in t_dict:
|
122 |
+
st.write('Primary Key:',t_dict['primary_key'])
|
123 |
+
else:
|
124 |
+
st.write('Primary Key: No key can be detected')
|
125 |
+
st.write(cdetails)
|
126 |
+
|
127 |
+
if select_main == 'Single Table Discovery':
|
128 |
+
metadata = SingleTableMetadata()
|
129 |
+
conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};"
|
130 |
+
"Server=ipzilnpxsssp001.database.windows.net;"
|
131 |
+
"Database=Marcopolo_DB;"
|
132 |
+
"UID=ssikder004;"
|
133 |
+
"PWD=Marcopolo@123" )
|
134 |
+
query1="select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='Client' ORDER BY TABLE_NAME ASC"
|
135 |
+
table1=pd.read_sql_query(query1,con=conn)
|
136 |
+
table1['TABLE_NAME']=table1['TABLE_NAME'].astype('str')
|
137 |
+
table_selector=st.selectbox('SOURCE TABLE NAME',['brands','categories','CUSTOMER_MASTER_TBL_1','orders','order_items','products','staffs','stocks','stores'],index=None,placeholder='Select table for automated column mapping')
|
138 |
+
if table_selector is not None:
|
139 |
+
st.markdown('---')
|
140 |
+
query2="select * from [Client].["+table_selector+"]"
|
141 |
+
df = pd.read_sql_query(query2,con=conn)
|
142 |
+
main_list=df.columns.to_list()
|
143 |
+
sub_list=['ID','LOADID','FILE_NAME']
|
144 |
+
if any(main_list[i:i+len(sub_list)] == sub_list for i in range(len(main_list) - len(sub_list) + 1)):
|
145 |
+
df=df.drop(['ID','LOADID','FILE_NAME'],axis=1)
|
146 |
+
conn.close()
|
147 |
+
metadata = SingleTableMetadata()
|
148 |
+
metadata.detect_from_dataframe(df)
|
149 |
+
python_dict = metadata.to_dict()
|
150 |
+
if f'cont_{table_selector}' not in st.session_state:
|
151 |
+
with st.spinner("Processing Table"):
|
152 |
+
# Create a GenerativeModel instance
|
153 |
+
genai_mod = genai.GenerativeModel(
|
154 |
+
model_name='models/gemini-1.5-pro-latest'
|
155 |
+
)
|
156 |
+
if 'primary_key' in python_dict:
|
157 |
+
primary_key = python_dict['primary_key']
|
158 |
+
else:
|
159 |
+
primary_key = "Could Not be Identified"
|
160 |
+
|
161 |
+
|
162 |
+
story = f""" Details of the table:
|
163 |
+
table columns: {str(list(df.columns))}
|
164 |
+
column datatypes: {str(df.dtypes.to_string())}
|
165 |
+
table sample data: {df.head(10).to_string()}
|
166 |
+
"""
|
167 |
+
response = genai_mod.generate_content(textwrap.dedent("""
|
168 |
+
You are a SAP Data Migration expert. Please return a narration about the data. The narration should Include primary key name(if any) and a intellectual guess about the table schema. The data is a SAP data, you have to guess the object name/class name/schema name etc. of that data. Don't add unnecessary details. Strictly stick to the informations provided only.
|
169 |
+
Important: Please consider All fields are mandetorily during your analysis.
|
170 |
+
|
171 |
+
Here is the table details:
|
172 |
+
|
173 |
+
""") + story + f"The Primary Key is:{primary_key}" )
|
174 |
+
st.write(response.usage_metadata)
|
175 |
+
st.session_state[f'cont_{table_selector}'] = response.text
|
176 |
+
with stylable_container(
|
177 |
+
key=f"container_with_border",
|
178 |
+
css_styles="""
|
179 |
+
{
|
180 |
+
border: 1px solid white;
|
181 |
+
border-radius: 0.5rem;
|
182 |
+
padding: calc(1em - 1px);
|
183 |
+
width: 110%; /* Set container width to 100% */
|
184 |
+
}
|
185 |
+
"""
|
186 |
+
):
|
187 |
+
st.write(st.session_state[f'cont_{table_selector}'])
|
188 |
+
col9, col10, col11 = st.columns([2, 3, 9])
|
189 |
+
with col9:
|
190 |
+
preview= st.button("PREVIEW TABLE",key='preview')
|
191 |
+
# with col10:
|
192 |
+
# cdet = st.button("GET COLUMN DETAILS",key='prof')
|
193 |
+
if preview:
|
194 |
+
st.dataframe(df)
|
195 |
+
# if cdet:
|
196 |
+
# cdetails=pd.DataFrame(columns=['Column Name','Data Type','Personal Identifiable Information'])
|
197 |
+
# c_dict=python_dict['columns']
|
198 |
+
# i=0
|
199 |
+
# for key in c_dict:
|
200 |
+
# e_dict=c_dict[key]
|
201 |
+
# if 'pii' in e_dict:
|
202 |
+
# p='YES'
|
203 |
+
# else:
|
204 |
+
# p='NO'
|
205 |
+
# if e_dict['sdtype']=='datetime':
|
206 |
+
# v=e_dict['sdtype']+': '+e_dict['datetime_format']
|
207 |
+
# else:
|
208 |
+
# v=e_dict['sdtype']
|
209 |
+
# new_row=pd.DataFrame({'Column Name':key,'Data Type':v,'Personal Identifiable Information':p},index=[i])
|
210 |
+
# cdetails=pd.concat([cdetails, new_row],ignore_index=True)
|
211 |
+
# i=i+1
|
212 |
+
# if 'primary_key' in python_dict:
|
213 |
+
# st.write('Primary Key:',python_dict['primary_key'])
|
214 |
+
# else:
|
215 |
+
# st.write('Primary Key: No key can be detected')
|
216 |
+
# st.write(cdetails)
|
217 |
+
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
|
backup/DATA CATALOG.py
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import numpy as np
|
3 |
+
import streamlit as st
|
4 |
+
import sdv
|
5 |
+
from sdv.datasets.local import load_csvs
|
6 |
+
from sdv.metadata import MultiTableMetadata
|
7 |
+
from sdv.multi_table import HMASynthesizer
|
8 |
+
import time
|
9 |
+
|
10 |
+
import os
|
11 |
+
import gc
|
12 |
+
import warnings
|
13 |
+
import plotly.express as px
|
14 |
+
from PIL import Image
|
15 |
+
from io import BytesIO
|
16 |
+
from IPython.display import Image as IPImage, display
|
17 |
+
from PyPDF2 import PdfReader
|
18 |
+
from fpdf import FPDF
|
19 |
+
import statsmodels.api as sm
|
20 |
+
import matplotlib.pyplot as plt
|
21 |
+
import seaborn as sns
|
22 |
+
import plotly.express as px
|
23 |
+
from IPython.display import Markdown
|
24 |
+
import kaleido
|
25 |
+
|
26 |
+
st.set_page_config(page_title='DATA DISCOVERY')
|
27 |
+
st.title('AUTOMATED DATA CATALOGUE')
|
28 |
+
st.subheader('SELECT DATABASE')
|
29 |
+
select1=st.selectbox('DATABASE NAME',('DB_10001','Marcopolo_db'),key='dbname',index=None,placeholder='Select database name')
|
30 |
+
if select1=='DB_10001':
|
31 |
+
with st.spinner('Performing Data Discovery'):
|
32 |
+
time.sleep(2)
|
33 |
+
st.success('Data cataloguing complete!')
|
34 |
+
datasets = load_csvs(
|
35 |
+
folder_name='BIKE_STORE_DATABASE/',
|
36 |
+
read_csv_parameters={
|
37 |
+
'skipinitialspace': True,
|
38 |
+
'encoding': 'utf_8'
|
39 |
+
})
|
40 |
+
metadata = MultiTableMetadata()
|
41 |
+
metadata.detect_from_csvs(folder_name='BIKE_STORE_DATABASE/')
|
42 |
+
python_dict = metadata.to_dict()
|
43 |
+
st.markdown('---')
|
44 |
+
st.subheader('DATA CATALOG')
|
45 |
+
# st.json(python_dict)
|
46 |
+
brands=datasets['brands']
|
47 |
+
categories=datasets['categories']
|
48 |
+
customers=datasets['customers']
|
49 |
+
orderitems=datasets['order_items']
|
50 |
+
orders=datasets['orders']
|
51 |
+
products=datasets['products']
|
52 |
+
staffs=datasets['staffs']
|
53 |
+
stocks=datasets['stocks']
|
54 |
+
stores=datasets['stores']
|
55 |
+
tables=python_dict['tables']
|
56 |
+
table_names=[*tables]
|
57 |
+
col1, col2, col3 = st.columns([2,2,2])
|
58 |
+
|
59 |
+
with col1:
|
60 |
+
def view_callback():
|
61 |
+
st.session_state.tdet = False
|
62 |
+
view= st.button("LIST TABLES",key='view',on_click=view_callback)
|
63 |
+
with col2:
|
64 |
+
if 'tdet' not in st.session_state:
|
65 |
+
st.session_state.tdet = False
|
66 |
+
tdet1 = st.button("SHOW TABLE DETAILS")
|
67 |
+
with col3:
|
68 |
+
rel=st.button('SHOW RELATIONSHIPS',key='rel',on_click=view_callback)
|
69 |
+
|
70 |
+
if tdet1:
|
71 |
+
st.session_state.tdet = tdet1
|
72 |
+
if view:
|
73 |
+
#st.write(python_dict)
|
74 |
+
st.write(pd.DataFrame(table_names,columns=['TABLE NAME']))
|
75 |
+
|
76 |
+
if rel:
|
77 |
+
rlist1=python_dict['relationships']
|
78 |
+
rdf=pd.DataFrame(columns=['PARENT TABLE','CHILD TABLE','PARENT PRIMARY KEY','CHILD FOREIGN KEY'])
|
79 |
+
for i in range(len(rlist1)):
|
80 |
+
rlist=rlist1[i]
|
81 |
+
nrow=pd.DataFrame({'PARENT TABLE':rlist['parent_table_name'],'CHILD TABLE':rlist['child_table_name'],'PARENT PRIMARY KEY':rlist['parent_primary_key'],'CHILD FOREIGN KEY':rlist['child_foreign_key']},index=[i])
|
82 |
+
rdf=pd.concat([rdf,nrow],ignore_index=True)
|
83 |
+
st.write(rdf)
|
84 |
+
if st.session_state.tdet is True:
|
85 |
+
def tdet_callback():
|
86 |
+
st.session_state.tdet=True
|
87 |
+
st.subheader('Select table name to view')
|
88 |
+
sbox1=st.selectbox('TABLE NAME',table_names,index=None,placeholder='Select table name',on_change=tdet_callback)
|
89 |
+
col4, col5 = st.columns([1, 3])
|
90 |
+
with col4:
|
91 |
+
preview= st.button("PREVIEW TABLE",key='preview')
|
92 |
+
with col5:
|
93 |
+
cdet = st.button("GET COLUMN DETAILS",key='prof')
|
94 |
+
if preview:
|
95 |
+
st.write(datasets[sbox1])
|
96 |
+
if cdet:
|
97 |
+
cdetails=pd.DataFrame(columns=['Column Name','Data Type','Personal Identifiable Information'])
|
98 |
+
t_dict=tables[sbox1]
|
99 |
+
c_dict=t_dict['columns']
|
100 |
+
i=0
|
101 |
+
for key in c_dict:
|
102 |
+
e_dict=c_dict[key]
|
103 |
+
if 'pii' in e_dict:
|
104 |
+
p='YES'
|
105 |
+
else:
|
106 |
+
p='NO'
|
107 |
+
if e_dict['sdtype']=='datetime':
|
108 |
+
v=e_dict['sdtype']+': '+e_dict['datetime_format']
|
109 |
+
else:
|
110 |
+
v=e_dict['sdtype']
|
111 |
+
new_row=pd.DataFrame({'Column Name':key,'Data Type':v,'Personal Identifiable Information':p},index=[i])
|
112 |
+
cdetails=pd.concat([cdetails, new_row],ignore_index=True)
|
113 |
+
i=i+1
|
114 |
+
if 'primary_key' in t_dict:
|
115 |
+
st.write('Primary Key:',t_dict['primary_key'])
|
116 |
+
else:
|
117 |
+
st.write('Primary Key: No key can be detected')
|
118 |
+
st.write(cdetails)
|
119 |
+
|
120 |
+
|
121 |
+
|
data/1714740977.8544624-gemini_messages
ADDED
Binary file (16.7 kB). View file
|
|
data/1714740977.8544624-st_messages
ADDED
Binary file (2.62 kB). View file
|
|
data/1714983684.3830516-gemini_messages
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
�]�.
|
data/1714983684.3830516-st_messages
ADDED
Binary file (586 Bytes). View file
|
|
data/1715077374.7732036-gemini_messages
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
�]�.
|
data/1715077374.7732036-st_messages
ADDED
Binary file (155 Bytes). View file
|
|
data/1715077982.0880668-gemini_messages
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
�]�.
|
data/1715077982.0880668-st_messages
ADDED
Binary file (666 Bytes). View file
|
|
data/1715078619.2998087-gemini_messages
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
�]�.
|
data/1715078619.2998087-st_messages
ADDED
Binary file (286 Bytes). View file
|
|
data/1715082116.767178-gemini_messages
ADDED
Binary file (9.27 kB). View file
|
|
data/1715082116.767178-st_messages
ADDED
Binary file (112 kB). View file
|
|
data/1715086623.645372-gemini_messages
ADDED
Binary file (9.47 kB). View file
|
|
data/1715086623.645372-st_messages
ADDED
Binary file (21.9 kB). View file
|
|
data/1715103041.8389978-gemini_messages
ADDED
Binary file (4.83 kB). View file
|
|
data/1715103041.8389978-st_messages
ADDED
Binary file (3.85 kB). View file
|
|
data/1715249415.4287577-gemini_messages
ADDED
Binary file (9.65 kB). View file
|
|
data/1715249415.4287577-st_messages
ADDED
Binary file (7.23 kB). View file
|
|
data/1717564238.3270795-gemini_messages
ADDED
Binary file (4.74 kB). View file
|
|
data/1717564238.3270795-st_messages
ADDED
Binary file (4.09 kB). View file
|
|
data/1717579231.916155-gemini_messages
ADDED
Binary file (4.82 kB). View file
|
|
data/1717579231.916155-st_messages
ADDED
Binary file (3.83 kB). View file
|
|
data/1717580421.5748234-gemini_messages
ADDED
Binary file (9.53 kB). View file
|
|
data/1717580421.5748234-st_messages
ADDED
Binary file (6.96 kB). View file
|
|
data/1717672759.119191-gemini_messages
ADDED
Binary file (4.75 kB). View file
|
|
data/1717672759.119191-st_messages
ADDED
Binary file (21.3 kB). View file
|
|
data/1718020955.6171474-gemini_messages
ADDED
Binary file (10.2 kB). View file
|
|
data/1718020955.6171474-st_messages
ADDED
Binary file (24.2 kB). View file
|
|
data/1718025984.855813-gemini_messages
ADDED
Binary file (4.99 kB). View file
|
|
data/1718025984.855813-st_messages
ADDED
Binary file (4 kB). View file
|
|
data/1718101291.9514854-gemini_messages
ADDED
Binary file (4.98 kB). View file
|
|
data/1718101291.9514854-st_messages
ADDED
Binary file (3.8 kB). View file
|
|
data/1718212497.2504222-gemini_messages
ADDED
Binary file (4.08 kB). View file
|
|
data/1718212497.2504222-st_messages
ADDED
Binary file (25.8 kB). View file
|
|
data/1718255487.3908408-gemini_messages
ADDED
Binary file (17.5 kB). View file
|
|
data/1718255487.3908408-st_messages
ADDED
Binary file (391 kB). View file
|
|
data/1718276733.3224595-gemini_messages
ADDED
Binary file (8.73 kB). View file
|
|
data/1718276733.3224595-st_messages
ADDED
Binary file (7.11 kB). View file
|
|
data/1718278412.7311835-gemini_messages
ADDED
Binary file (4.11 kB). View file
|
|
data/1718278412.7311835-st_messages
ADDED
Binary file (40.7 kB). View file
|
|
data/1718360522.2414901-gemini_messages
ADDED
Binary file (6.47 kB). View file
|
|
data/1718360522.2414901-st_messages
ADDED
Binary file (3.73 kB). View file
|
|
data/1718361823.6470416-gemini_messages
ADDED
Binary file (6.53 kB). View file
|
|
data/1718361823.6470416-st_messages
ADDED
Binary file (3.76 kB). View file
|
|
data/1718709779.1290016-gemini_messages
ADDED
Binary file (7.38 kB). View file
|
|
data/1718709779.1290016-st_messages
ADDED
Binary file (3.85 kB). View file
|
|
data/1718715582.2066972-gemini_messages
ADDED
Binary file (22.5 kB). View file
|
|