Skip to content

Commit

Permalink
Internal bugfix.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630890157
  • Loading branch information
raj-sinha authored and The spade_anomaly_detection Authors committed May 7, 2024
1 parent 25cd154 commit fc19154
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish to PyPi

# Only trigger the workflow manually (e.g. when deps changes)
on: workflow_dispatch

jobs:
# Publish when version is increased
publish-job:
# Only try to publish if:
# * Repo is self (prevents running from forks)
# * Branch is `main`
if: |
github.repository == 'google-research/spade_anomaly_detection'
&& github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30

steps:
# Publish the package (if local `__version__` > pip version)
- uses: etils-actions/[email protected]
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
parse-changelog: true
1 change: 0 additions & 1 deletion .github/workflows/pytest_and_autopublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ jobs:
- uses: etils-actions/[email protected]
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
parse-changelog: true
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ keywords = ["anomaly detection", "ensemble model", "one class classifiers"]
# pip dependencies of the project
# Installed locally with `pip install -e .`
dependencies = [
"absl-py==1.0.0",
"absl-py==1.4.0",
"frozendict==2.3.2",
"joblib==1.1.0",
"joblib==1.2.0",
"pandas==1.3.5",
"pyarrow==10.0.0",
"pyarrow==14.0.1",
"retry==0.9.2",
"scikit-learn",
"scikit-learn==1.4.2",
"parameterized==0.8.1",
"pytest==7.1.2",
"fastavro[codecs]==1.4.12",
Expand Down
3 changes: 1 addition & 2 deletions spade_anomaly_detection/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

import tensorflow as tf


_DATA_ROOT = 'third_party/py/spade_anomaly_detection/example_data/'
_DATA_ROOT = 'spade_anomaly_detection/example_data/'


def load_dataframe(
Expand Down
4 changes: 4 additions & 0 deletions spade_anomaly_detection/data_loader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import numpy as np
import pandas as pd

import pytest

from spade_anomaly_detection import data_loader
from spade_anomaly_detection import parameters
from spade_anomaly_detection.data_utils import bq_dataset
Expand Down Expand Up @@ -634,6 +636,7 @@ def test_get_bigquery_job_config(self):
self.assertEqual(job_config.write_disposition, 'WRITE_TRUNCATE')
self.assertEqual(job_config.source_format, bigquery.SourceFormat.PARQUET)

@pytest.mark.skip(reason="create_tempdir is broken in pytest")
def test_construct_file_paths_for_gcs(self):
data_loader_object = data_loader.DataLoader(self.runner_parameters)
local_folder = 'test_folder'
Expand All @@ -658,6 +661,7 @@ def test_construct_file_paths_for_gcs(self):
('use_parquet', True),
('use_csv', False),
)
@pytest.mark.skip(reason="create_tempdir is broken in pytest")
def test_upload_data_to_local_disk(self, use_parquet: bool):
data_loader_object = data_loader.DataLoader(self.runner_parameters)
data_loader_object.input_feature_metadata = self._get_feature_metadata()
Expand Down
6 changes: 3 additions & 3 deletions spade_anomaly_detection/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
absl-py==1.0.0
absl-py==1.4.0
frozendict==2.3.2
joblib==1.2.0
pandas==1.3.5
pyarrow==14.0.1
retry==0.9.2
scikit-learn
scikit-learn==1.4.2
parameterized==0.8.1
# These are test dependencies and should be added as part of a seperate layer
# These are test dependencies and should be added as part of a separate layer
# in the container that isn't included in the base container.
pytest==7.1.2
# These are nested dependencies.
Expand Down

0 comments on commit fc19154

Please sign in to comment.