Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few bugs #124

Merged
merged 5 commits into from
May 8, 2024
Merged
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
31 changes: 31 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,34 @@ jobs:

- name: 🚀 Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

upload-coverage:
runs-on: ubuntu-latest
needs: deploy-prod

steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
show-progress: false

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: setup.py

- name: 🏗 Install module
run: pip install .[tests]

- name: ⚙️ Add config file
run: cp config.sample.json config.json

- name: 🧪 Run tests
run: pytest

- name: ⬆️ Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cov.xml
10 changes: 5 additions & 5 deletions src/sweeper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
sweeper

Usage:
sweeper sweep duplicates --workspace=<workspace> [--table-name=<table_name> --verbose --try-fix --change-detect --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep empties --workspace=<workspace> [--table-name=<table_name> --verbose --try-fix --change-detect --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep invalids --workspace=<workspace> [--table-name=<table_name> --verbose --try-fix --change-detect --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep duplicates --workspace=<workspace> [--table-name=<table_name> | --change-detect] [--verbose --try-fix --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep empties --workspace=<workspace> [--table-name=<table_name> | --change-detect] [--verbose --try-fix --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep invalids --workspace=<workspace> [--table-name=<table_name> | --change-detect] [--verbose --try-fix --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep addresses --workspace=<workspace> --table-name=<table-name> --field-name=<field_name> [--verbose --try-fix --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep metadata --workspace=<workspace> [--table-name=<table_name> --verbose --try-fix --change-detect --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep --workspace=<workspace> [--table-name=<table_name> --verbose --try-fix --change-detect --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep metadata --workspace=<workspace> [--table-name=<table_name> | --change-detect] [--verbose --try-fix --scheduled --save-report=<report_path> --backup-to=<backup_path>]
sweeper sweep --workspace=<workspace> [--table-name=<table_name> | --change-detect] [--verbose --try-fix --scheduled --save-report=<report_path> --backup-to=<backup_path>]

Arguments:
workspace - path to workspace eg: `c:\\my.gdb`
Expand Down
3 changes: 2 additions & 1 deletion src/sweeper/workspace_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
if checked_date:
checked_string = datetime.datetime.strptime(checked_date, "%Y-%m-%d")
else:
#: this was a deliberate choice so that the first time sweeper is run, it won't processes all tables
checked_string = datetime.date.today()

last_checked = checked_string.strftime("%m/%d/%Y")
log.info(f"Last date change detection was checked: {last_checked}")

egdb = Path(config.get_config("CHANGE_DETECTION_CONNECTION"))
egdb = Path(config.get_config("CONNECTIONS_FOLDER")) / config.get_config("CHANGE_DETECTION_CONNECTION")

Check warning on line 85 in src/sweeper/workspace_info.py

View check run for this annotation

Codecov / codecov/patch

src/sweeper/workspace_info.py#L85

Added line #L85 was not covered by tests
cd_table = config.get_config("CHANGE_DETECTION_TABLE")

egdb_conn = arcpy.ArcSDESQLExecute(str(egdb))
Expand Down