diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml new file mode 100644 index 0000000..3a21a82 --- /dev/null +++ b/.github/workflows/python-lint.yml @@ -0,0 +1,39 @@ +name: Ruff Linting + +on: + push: + branches: [ "main" ] + paths: + - 'py-denormalized/**' # Only trigger on changes in this directory + pull_request: + branches: [ "main" ] + paths: + - 'py-denormalized/**' # Only trigger on changes in this directory + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: py-denormalized # Set the working directory for all run steps + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install Ruff + run: pip install ruff + + - name: Run Ruff + # Ruff will look for pyproject.toml in the py-denormalized directory + run: | + # Run Ruff linter + ruff check . + # Run Ruff formatter + ruff format . --check diff --git a/py-denormalized/pyproject.toml b/py-denormalized/pyproject.toml index 5d17649..c7adff2 100644 --- a/py-denormalized/pyproject.toml +++ b/py-denormalized/pyproject.toml @@ -33,8 +33,8 @@ dev-dependencies = [ # Enable docstring linting using the google style guide [tool.ruff.lint] -select = ["E4", "E7", "E9", "F", "D", "W"] -ignore = ["D103"] +# select = ["E4", "E7", "E9", "F", "D", "W"] +ignore = ["F", "D100", "D101", "D102", "D103", "D107"] [tool.ruff.lint.pydocstyle] convention = "google" diff --git a/py-denormalized/python/denormalized/feast_data_stream.py b/py-denormalized/python/denormalized/feast_data_stream.py index e289b8c..c4124d4 100644 --- a/py-denormalized/python/denormalized/feast_data_stream.py +++ b/py-denormalized/python/denormalized/feast_data_stream.py @@ -3,7 +3,6 @@ import pyarrow as pa from denormalized._d_internal import PyDataStream -from denormalized.datafusion import Expr from feast import FeatureStore, Field from feast.data_source import PushMode from feast.type_map import pa_to_feast_value_type diff --git a/py-denormalized/python/examples/udaf_example.py b/py-denormalized/python/examples/udaf_example.py index 724fdf0..ed8c581 100644 --- a/py-denormalized/python/examples/udaf_example.py +++ b/py-denormalized/python/examples/udaf_example.py @@ -9,7 +9,6 @@ from denormalized import Context from denormalized.datafusion import Accumulator, col -from denormalized.datafusion import functions as f from denormalized.datafusion import udaf