Skip to content

Commit

Permalink
Merge pull request #283 from investigativedata/develop
Browse files Browse the repository at this point in the history
v0.6.8
  • Loading branch information
simonwoerpel authored Jul 11, 2024
2 parents cf8b83e + 3466592 commit acdc899
Show file tree
Hide file tree
Showing 15 changed files with 870 additions and 2,051 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.7
current_version = 0.6.8
commit = True
tag = True
message = 🔖 Bump version: {current_version} → {new_version}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# python-version: ["3.11", "3.12"]
python-version: ["3.11"]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repos:
exclude: (test_[\w]+\.py|\.csv|\.json|\.lock)$

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
exclude: (test_[\w]+\.py|\.csv|\.i?json|\.lock)$
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-bookworm
FROM python:3.12-bookworm

RUN apt-get -qq update && apt-get -qq -y upgrade
RUN apt-get install -qq -y pkg-config libicu-dev libleveldb-dev
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.7
0.6.8
2 changes: 1 addition & 1 deletion ftmq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ftmq.query import Query

__version__ = "0.6.7"
__version__ = "0.6.8"
__all__ = ["Query"]
6 changes: 5 additions & 1 deletion ftmq/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from nomenklatura.entity import CE, CompositeEntity
from nomenklatura.util import PathLike

from ftmq.exceptions import ValidationError
from ftmq.query import Query
from ftmq.store import Store, get_store
from ftmq.types import CEGenerator, SDict
Expand Down Expand Up @@ -49,7 +50,10 @@ def smart_read_proxies(
proxies = (make_proxy(line) for line in lines)
yield from q.apply_iter(proxies)
else:
yield from lines
for line in lines:
if line.get("id") is None:
raise ValidationError("Entity has no ID.")
yield line


def smart_write_proxies(
Expand Down
4 changes: 4 additions & 0 deletions ftmq/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def __bool__(self) -> bool:
"""
return bool(self.to_dict())

def __hash__(self) -> int:
# generate unique key of the current state
return hash(repr(self.to_dict()))

def _chain(self, **kwargs):
# merge current state
new_kwargs = self.__dict__.copy()
Expand Down
Loading

0 comments on commit acdc899

Please sign in to comment.