Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

def main():
# Process command-line arguments
parser = argparse.ArgumentParser(description="Databricks job with catalog and schema parameters")
parser = argparse.ArgumentParser(
description="Databricks job with catalog and schema parameters",
)
parser.add_argument("--catalog", required=True)
parser.add_argument("--schema", required=True)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

def main():
# Process command-line arguments
parser = argparse.ArgumentParser(description="Databricks job with catalog and schema parameters")
parser = argparse.ArgumentParser(
description="Databricks job with catalog and schema parameters",
)
parser.add_argument("--catalog", required=True)
parser.add_argument("--schema", required=True)
args = parser.parse_args()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Note that [DATABRICKS_URL] is used for initialization.
✨ Your new project has been created in the 'my_pydabs' directory!

To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/python/index.html.
Checking code formatting with ruff format --line-length 88

>>> find my_pydabs -mindepth 1 ! -name pyproject.toml ! -regex .*/resources.* -delete
>>> ruff format --isolated --line-length 88 --quiet --diff --check my_pydabs
Checking code formatting with ruff format --line-length 120

>>> ruff format --quiet --diff --check my_pydabs
>>> ruff format --isolated --line-length 120 --quiet --diff --check my_pydabs

>>> yamlcheck.py
16 changes: 13 additions & 3 deletions acceptance/bundle/templates/pydabs/check-formatting/script
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ envsubst < input.json.tmpl > input.json

trace $CLI bundle init pydabs --config-file ./input.json

# only keep relevant files for snapshots
trace find my_pydabs -mindepth 1 ! -name 'pyproject.toml' ! -regex '.*/resources.*' -delete
# Use --isolated not to inherit ruff.toml in the repo root.
#
# Format both with line-length 88 to cover default formatter settings
# and 120 to cover default formatter settings in Workspace editor.
#
# You can use trailing comma to force line breaks to make formatting consistent
# with different line-length settings.

echo "Checking code formatting with ruff format --line-length 88"
trace ruff format --isolated --line-length 88 --quiet --diff --check my_pydabs

echo "Checking code formatting with ruff format --line-length 120"
trace ruff format --isolated --line-length 120 --quiet --diff --check my_pydabs

trace ruff format --quiet --diff --check my_pydabs
trace yamlcheck.py

rm -rf my_pydabs input.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ from {{.project_name}} import taxis

def main():
# Process command-line arguments
parser = argparse.ArgumentParser(description="Databricks job with catalog and schema parameters")
parser = argparse.ArgumentParser(
description="Databricks job with catalog and schema parameters",
)
parser.add_argument("--catalog", required=True)
parser.add_argument("--schema", required=True)
args = parser.parse_args()
Expand Down