osmose-backend icon indicating copy to clipboard operation
osmose-backend copied to clipboard

False positive on opening_hours with a ruleset override

Open xlii-chl opened this issue 1 year ago • 9 comments

Parser detects an incorrect opening_hours on Tu-Fr 11:00-19:00; Sa 10:00-22:15; 14:00-15:00 closed

It seems valid on https://wiki.openstreetmap.org/wiki/Key:opening_hours#Syntax since it's just a ruleset overriding a previous ruleset.

Openingh is ok, YoHours doesn't display anything.

Object :

  • https://www.openstreetmap.org/node/4579458237
  • http://localhost:8111/import?url=http://osmose.openstreetmap.fr/api/0.3/issue/dc81afc2-8ebe-2403-8024-ba2b8bdb3ed4/fix/0

(maybe duplicate of #1106 )

xlii-chl avatar Sep 26 '22 00:09 xlii-chl

http://osmose.openstreetmap.fr/nl/issue/dc81afc2-8ebe-2403-8024-ba2b8bdb3ed4

The proposed fix is definitely not meaning the same either, suspect this is a bug of the parser

Famlam avatar Sep 26 '22 06:09 Famlam

cc @dfaure

frodrigo avatar Sep 26 '22 09:09 frodrigo

Last time the reply came from @dfaure-kdab

Famlam avatar Oct 22 '22 13:10 Famlam

Ah, this is the same as https://bugs.kde.org/show_bug.cgi?id=445787 which I fixed long ago, so what's missing is to update KOpeningHours in osmose-backend again. Coming up, let's see if I remember how ;)

dfaure-kdab avatar Nov 05 '22 11:11 dfaure-kdab

Done but I'm still having problems testing the change. I do

cd docker
docker-compose -f docker-compose.yml -f docker-compose-dev.yml build
docker-compose -f docker-compose.yml -f docker-compose-dev.yml run backend bash

and then pytest -k Opening, which is IIRC what worked to run the tests in plugins/TagFix_Opening_Hours.py, but I get this error from pytest:


================================================================================================== ERRORS ===================================================================================================
____________________________________________________________________________________ ERROR collecting modules/OsmPbf.py _____________________________________________________________________________________
ImportError while importing test module '/opt/osmose-backend/modules/OsmPbf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
modules/OsmPbf.py:22: in <module>
    from . import OsmPbf_libosmbf
modules/OsmPbf_libosmbf.py:24: in <module>
    from .osm_pbf_parser import osm_pbf_parser
E   ImportError: cannot import name 'osm_pbf_parser' from 'modules.osm_pbf_parser' (/opt/osmose-backend/modules/osm_pbf_parser/__init__.py)

(and the same from modules/OsmPbf_libosmbf.py)

This seems completely unrelated to my changes, so I must be doing something wrong?

dfaure-kdab avatar Nov 05 '22 11:11 dfaure-kdab

@dfaure-kdab using dev docker, you have to rebuild on first run because of mounting volume. https://github.com/osm-fr/osmose-backend/tree/master/docker#start-docker-backend-container

frodrigo avatar Nov 05 '22 13:11 frodrigo

Specifically running this line I guess: cd modules/osm_pbf_parser/ && make && cd -

Famlam avatar Nov 05 '22 16:11 Famlam