Skip to content

Commit

Permalink
pandas_profiling_extractor | ♻️ Refactoring code.
Browse files Browse the repository at this point in the history
Signed-off-by: mgorsk1 <gorskimariusz13@gmail.com>
  • Loading branch information
mgorsk1 committed May 18, 2021
1 parent ee55930 commit 60274d0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions databuilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1229,12 +1229,15 @@ from databuilder.job.job import DefaultJob
from databuilder.loader.file_system_neo4j_csv_loader import FsNeo4jCSVLoader
from databuilder.task.task import DefaultTask

table_name = 'video_game_sales'
schema_name = 'superset'

# Load table contents to pandas dataframe
db_uri = 'postgresql://superset:superset@localhost:5432/superset'
db_uri = f'postgresql://superset:superset@localhost:5432/{schema_name}'
engine = create_engine(db_uri, echo=True)

df = pd.read_sql_table(
'video_game_sales',
table_name,
con=engine
)

Expand All @@ -1251,8 +1254,8 @@ dict_config = {
f'loader.filesystem_csv_neo4j.{FsNeo4jCSVLoader.NODE_DIR_PATH}': f'{tmp_folder}/nodes',
f'loader.filesystem_csv_neo4j.{FsNeo4jCSVLoader.RELATION_DIR_PATH}': f'{tmp_folder}/relationships',
f'loader.filesystem_csv_neo4j.{FsNeo4jCSVLoader.SHOULD_DELETE_CREATED_DIR}': False,
'extractor.pandas_profiling.table_name': 'video_game_sales',
'extractor.pandas_profiling.schema_name': 'superset',
'extractor.pandas_profiling.table_name': table_name,
'extractor.pandas_profiling.schema_name': schema_name,
'extractor.pandas_profiling.database_name': 'postgres',
'extractor.pandas_profiling.cluster_name': 'dev',
'extractor.pandas_profiling.file_path': report_file
Expand Down

0 comments on commit 60274d0

Please sign in to comment.