-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from pysql-beam-org/fix-precommit
pre-commit fix
- Loading branch information
Showing
14 changed files
with
749 additions
and
407 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
repos: | ||
# must be initialized via pre-commit install | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.2.0 | ||
hooks: | ||
- id: check-added-large-files # Prevent giant files from being committed | ||
- id: check-docstring-first # Checks a common error of defining a docstring after code. | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: end-of-file-fixer | ||
exclude_types: [svg] | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.6.2 | ||
hooks: | ||
- id: prettier | ||
exclude: > | ||
(?x)^( | ||
.*\.yaml | ||
)$ | ||
# Check for typos | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.1.0 | ||
hooks: | ||
- id: codespell | ||
args: [--ignore-words=allow.txt, --exclude-file=allow.txt] | ||
|
||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v2.29.1 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: ["--py38-plus"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/pycqa/bandit | ||
rev: 1.7.4 | ||
hooks: | ||
- id: bandit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,10 @@ | |
|
||
This package aim to provide Apache_beam io connector for MySQL, Postgres and MSSQL Database database. | ||
|
||
|
||
This package provides apache beam io connectors for postgres db, mssql db and mysql db. | ||
This package is a python implementation for those 3 io connectors | ||
|
||
FYI: it uses a pyodbc connector for the mssql implementation, but not for the other two connectors | ||
FYI: it uses a pyodbc connector for the mssql implementation, but not for the other two connectors | ||
|
||
Requirements: | ||
|
||
|
@@ -16,14 +15,12 @@ Requirements: | |
4. psycopg2-binary | ||
5. pyodbc | ||
|
||
|
||
Installation: | ||
|
||
1. pip install pysql-beam | ||
or | ||
1. pip install [email protected]:yesdeepakverma/pysql-beam.git | ||
|
||
|
||
Current functionality: | ||
|
||
1. Read from MySQL database by passing either table name or sql query | ||
|
@@ -34,14 +31,15 @@ Current functionality: | |
Reference Guide: | ||
|
||
1. Java IO connector for the same: | ||
https://github.com/spotify/dbeam | ||
https://github.com/spotify/dbeam | ||
|
||
2. How to write io connector for Apache Beam: | ||
https://beam.apache.org/documentation/io/developing-io-overview/ | ||
https://beam.apache.org/documentation/io/developing-io-python/ | ||
https://beam.apache.org/documentation/io/developing-io-overview/ | ||
|
||
https://beam.apache.org/documentation/io/developing-io-python/ | ||
|
||
Usage Guide: | ||
|
||
``` | ||
from pysql_beam.sql_io.sql import ReadFromSQL | ||
|
@@ -54,6 +52,7 @@ ReadFromSQL(host=options.host, port=options.port, | |
batch=100000) | ||
``` | ||
|
||
Examples: | ||
|
||
For mysql: | ||
|
@@ -63,8 +62,7 @@ Examples: | |
`python cloud_sql_to_bigquery.py --host localhost --port 5432 --database SECRET_DATABASE --username SECRET_USER --password SECRET_PASSWORD --table YOUR_TABLE --output_table 'MyProject:MyDataset.MyTable' --temp_location "gs://MyBucket/tmp"` | ||
|
||
For mssql: | ||
`python cloud_sql_to_bigquery.py --host localhost --port 1433 --database SECRET_DATABASE --username SECRET_USER --password SECRET_PASSWORD --query 'SELECT * from MyTable' --output_table 'MyProject:MyDataset.MyTable' --temp_location "gs://MyBucket/tmp"` | ||
|
||
`python cloud_sql_to_bigquery.py --host localhost --port 1433 --database SECRET_DATABASE --username SECRET_USER --password SECRET_PASSWORD --query 'SELECT * from MyTable' --output_table 'MyProject:MyDataset.MyTable' --temp_location "gs://MyBucket/tmp"` | ||
|
||
contribution: | ||
You can contribute to this package by raising bugs or sending pull requests | ||
You can contribute to this package by raising bugs or sending pull requests |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Oops, something went wrong.