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

Run continuous integration tests when code is changed in the src directory as well #322

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
filters: |
pgstac:
- 'docker/pgstac/**'
- 'src/pgstac/pgstac.sql'
pypgstac:
- 'docker/pypgstac/**'
- 'src/**'
- id: check
run: |
buildpg=false;
Expand Down Expand Up @@ -101,6 +103,7 @@ jobs:
test:
name: test
needs: [changes, buildpg, buildpyrust]
if: ${{ needs.changes.outputs.buildpgdocker == 'true' || needs.changes.outputs.buildpyrustdocker == 'true' }}
runs-on: ubuntu-latest
container:
image: ${{ needs.changes.outputs.pyrustdocker }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Add `open=True` in `psycopg.ConnectionPool` to avoid future behavior change
- Switch from postgres `server_version` to `server_version_num` to get PG version (Fixes #300)
- Allow read-only replicas work even when the context extension is enabled (Fixes #300)
- Run continuous integration tests when code is changed in the `src` directory as well (Fixes #321)

## [v0.9.1]

Expand Down
4 changes: 2 additions & 2 deletions docker/pypgstac/bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ function test_formatting(){
cd $SRCDIR/pypgstac

echo "Running ruff"
ruff -n python tests
ruff -n src tests

echo "Running mypy"
mypy python
mypy src

echo "Checking if there are any staged migrations."
find $SRCDIR/pgstac/migrations | grep 'staged' && { echo "There are staged migrations in pypgstac/migrations. Please check migrations and remove staged suffix."; exit 1; }
Expand Down
8 changes: 4 additions & 4 deletions src/pypgstac/src/pypgstac/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,12 @@ def _partition_update(self, item: Dict[str, Any]) -> str:
),
)
if db_rows:
datetime_range_min: Optional[datetime] = db_rows[0][0] or datetime.min
datetime_range_max: Optional[datetime] = db_rows[0][1] or datetime.max
end_datetime_range_min: Optional[datetime] = (
datetime_range_min: datetime = db_rows[0][0] or datetime.min
datetime_range_max: datetime = db_rows[0][1] or datetime.max
end_datetime_range_min: datetime = (
db_rows[0][2] or datetime.min
)
end_datetime_range_max: Optional[datetime] = (
end_datetime_range_max: datetime = (
db_rows[0][3] or datetime.max
)

Expand Down