Skip to content
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
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ updates:
day: "monday"
time: "09:00"
timezone: "Europe/Paris"
open-pull-requests-limit: 8
open-pull-requests-limit: 0
commit-message:
prefix: "chore(deps)"
groups:
Expand Down Expand Up @@ -45,7 +45,7 @@ updates:
day: "monday"
time: "09:30"
timezone: "Europe/Paris"
open-pull-requests-limit: 3
open-pull-requests-limit: 0
commit-message:
prefix: "chore(ci)"
groups:
Expand All @@ -60,7 +60,7 @@ updates:
day: "monday"
time: "10:00"
timezone: "Europe/Paris"
open-pull-requests-limit: 3
open-pull-requests-limit: 0
commit-message:
prefix: "chore(pre-commit)"
groups:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_publish-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v7

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_test-regressions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test-units.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.15.21
rev: v0.15.22
hooks:
- id: ruff-check
args: [ --fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -31,7 +31,7 @@ repos:
stages: [pre-push]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.2.0
rev: v2.3.0
hooks:
- id: mypy
args: []
Expand Down
6 changes: 3 additions & 3 deletions mindee/v2/parsing/inference/field/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from mindee.v2.parsing.inference.field.simple_field import SimpleField


def parse_field(raw_response: StringDict, indent_level: int = 0):
def create_field(raw_response: StringDict, indent_level: int = 0):
"""The central parser function to be injected down the tree."""
if "value" in raw_response:
return SimpleField(raw_response, indent_level)
if "items" in raw_response:
return ListField(raw_response, parse_field, indent_level)
return ListField(raw_response, create_field, indent_level)
if "fields" in raw_response:
return ObjectField(raw_response, parse_field, indent_level)
return ObjectField(raw_response, create_field, indent_level)

raise MindeeAPIV2Error(f"Unrecognized field type in {raw_response}.")
4 changes: 2 additions & 2 deletions mindee/v2/product/extraction/extraction_result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mindee.parsing.common.string_dict import StringDict
from mindee.v2.parsing.inference.field import InferenceFields
from mindee.v2.parsing.inference.field.factory import parse_field
from mindee.v2.parsing.inference.field.factory import create_field
from mindee.v2.parsing.inference.rag_metadata import RAGMetadata
from mindee.v2.parsing.inference.raw_text import RawText

Expand All @@ -16,7 +16,7 @@ class ExtractionResult:
"""RAG metadata."""

def __init__(self, raw_response: StringDict) -> None:
self.fields = InferenceFields(raw_response["fields"], parse_field)
self.fields = InferenceFields(raw_response["fields"], create_field)
if raw_response.get("raw_text"):
self.raw_text = RawText(raw_response["raw_text"])
if raw_response.get("rag"):
Expand Down