Michal Masrna Michal Masrna commited on
Commit
b88edf5
·
1 Parent(s): 287997a

fix: laws.py added missing import logging (#3501)

Browse files

### What problem does this PR solve?

_Choosing Laws Chunk Method results in an error when parsing a document.
The error is caused by a missing import in the `laws.py` file._

```
Traceback (most recent call last):
File "/ragflow/rag/svr/task_executor.py", line 445, in handle_task
do_handle_task(task)
File "/ragflow/rag/svr/task_executor.py", line 384, in do_handle_task
cks = build(r)
^^^^^^^^
File "/ragflow/rag/svr/task_executor.py", line 196, in build
cks = chunker.chunk(row["name"], binary=binary, from_page=row["from_page"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/app/laws.py", line 161, in chunk
for txt, poss in pdf_parser(filename if not binary else binary,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/app/laws.py", line 124, in __call__
logging.debug("layouts:".format(
^^^^^^^
NameError: name 'logging' is not defined. Did you forget to import 'logging'

```

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

Co-authored-by: Michal Masrna <[email protected]>

Files changed (1) hide show
  1. rag/app/laws.py +1 -0
rag/app/laws.py CHANGED
@@ -10,6 +10,7 @@
10
  # See the License for the specific language governing permissions and
11
  # limitations under the License.
12
  #
 
13
  from tika import parser
14
  import re
15
  from io import BytesIO
 
10
  # See the License for the specific language governing permissions and
11
  # limitations under the License.
12
  #
13
+ import logging
14
  from tika import parser
15
  import re
16
  from io import BytesIO