diff --git a/.gitignore b/.gitignore index 3314de1..1a749fa 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ _local # Output directory of the package itself **/output +**/target/bq2dbt # Distribution / packaging build/ diff --git a/bq2dbt/__init__.py b/bq2dbt/__init__.py index 3d2d763..9613e71 100644 --- a/bq2dbt/__init__.py +++ b/bq2dbt/__init__.py @@ -5,5 +5,9 @@ and basic select query with explicit columns list """ -__version__ = "0.1.0" -__author__ = 'Henri-Maxime Ducoulombier' +from .bq2dbt import bq2dbt + + +def main(): + """Entry point for the application script""" + bq2dbt() diff --git a/bq2dbt/bq2dbt.py b/bq2dbt/bq2dbt.py index 1b6a54b..f383a30 100755 --- a/bq2dbt/bq2dbt.py +++ b/bq2dbt/bq2dbt.py @@ -125,7 +125,7 @@ def bq2dbt(): field_info = { "name": destination, "data_type": data_type.lower() if args.lower else data_type, - "description": field.description + "description": field.description or "" } if field.is_nullable == 'NO': field_info = {**field_info, **{ @@ -165,7 +165,3 @@ def bq2dbt(): sql_file.write(sql_output.strip()) logger.info("Operation complete") - - -if __name__ == '__main__': - bq2dbt() diff --git a/pyproject.toml b/pyproject.toml index b16b8e2..0f96572 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,9 @@ dependencies = [ ] dynamic = ["version"] +[project.scripts] # Optional +bq2dbt = "bq2dbt:bq2dbt" + [tool.setuptools] packages = ["bq2dbt"]