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

ignore ahb tables where no pruefi is provided #371

Conversation

DeltaDaniel
Copy link
Contributor

No description provided.

Copy link
Contributor

@hf-kklein hf-kklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DeltaDaniel DeltaDaniel merged commit cf2e14e into main Jul 11, 2024
10 checks passed
@DeltaDaniel DeltaDaniel deleted the 356-kohlrahbi-crashes-with-fv2504-documents-collector-should-not-be-empty branch July 11, 2024 05:21
Comment on lines +192 to +194
pattern = r"Prüfidentifikator(?:\t){0,10}\t\d+"
# "matches "Prüfidentifikator" followed by at least 1 tab separated numbers, max 11 pruefis is chosen arbitrarily
return bool(re.search(pattern, table.row_cells(0)[-1].text))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hf-kklein gab es hier nicht noch ein anderes pattern was das pattern irgendwie compiled hat?
Ziel war es dass das regex nur einmal ausgeführt werden muss.

Oft haben wir das pattern global ausgelagert und dann in der Funktion nur angewendet.

Weißt du was ich meine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my_pattern = re.comile(r"Prüfidentifikator(?:\t){0,10}\t\d+")

und dann mypattern.search(...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bringt dann was, wenn die funktion sehr oft aufgerufen wird. wobei auch so der regex-teil einen internen cache hat iirc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. Die Funktion wir in jeder Tabelle aufgerufen. Aber wenn sie einen internen Cache hat passt das.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kohlrahbi crashes with FV2504 documents: "collector should not be empty"
3 participants