Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue 2066 - updated sample MySQL data loader file. Signed-off-by: Malavika <[email protected]> #2067

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
14 changes: 9 additions & 5 deletions databuilder/example/scripts/sample_mysql_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
into Neo4j and Elasticsearch without using an Airflow DAG.

"""

import pymysql
import logging
import sys
import textwrap
import uuid

pymysql.install_as_MySQLdb()

from elasticsearch import Elasticsearch
from pyhocon import ConfigFactory
from sqlalchemy.ext.declarative import declarative_base
Expand Down Expand Up @@ -56,11 +58,12 @@

# todo: connection string needs to change
def connection_string():
user = 'username'
user = 'root'
password='root'
host = 'localhost'
port = '3306'
db = 'mysql'
return "mysql://%s@%s:%s/%s" % (user, host, port, db)
port = '3307'
db = 'test_db'
return "mysql+pymysql://%s:%s@%s:%s/%s" % (user,password, host, port, db)


def run_mysql_job():
Expand All @@ -83,6 +86,7 @@ def run_mysql_job():
f'publisher.neo4j.{neo4j_csv_publisher.NEO4J_END_POINT_KEY}': neo4j_endpoint,
f'publisher.neo4j.{neo4j_csv_publisher.NEO4J_USER}': neo4j_user,
f'publisher.neo4j.{neo4j_csv_publisher.NEO4J_PASSWORD}': neo4j_password,
f'publisher.neo4j.{neo4j_csv_publisher.NEO4J_ENCRYPTED}': False,
f'publisher.neo4j.{neo4j_csv_publisher.JOB_PUBLISH_TAG}': 'unique_tag', # should use unique tag here like {ds}
})
job = DefaultJob(conf=job_config,
Expand Down
4 changes: 2 additions & 2 deletions databuilder/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
__version__ = '7.4.3'

requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'requirements.txt')
'../requirements.txt')
with open(requirements_path, 'r') as requirements_file:
requirements = requirements_file.readlines()

requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'requirements-dev.txt')
'../requirements-dev.txt')
with open(requirements_path, 'r') as requirements_file:
requirements_dev = requirements_file.readlines()

Expand Down