obadx / prepare-quran-dataset

Preparing and chuncking quran dataset
MIT License
0 stars 0 forks source link

Insert Moshaf with spcific sources only #13

Closed Abdullahaml1 closed 2 weeks ago

Abdullahaml1 commented 3 weeks ago

Insert an item with empty source (specific_sources) only and source is used for hashing so when more than item have no sources will result for ItemExist Exception

Traceback (most recent call last):
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
    result = func()
             ^^^^^^
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 545, in code_to_exec
    self._session_state.on_script_will_rerun(
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/state/safe_session_state.py", line 66, in on_script_will_rerun
    self._state.on_script_will_rerun(latest_widget_states)
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/state/session_state.py", line 515, in on_script_will_rerun
    self._call_callbacks()
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/state/session_state.py", line 528, in _call_callbacks
    self._new_widget_state.call_callback(wid)
  File "/home/abdullah/miniconda3/envs/prepare-ds/lib/python3.12/site-packages/streamlit/runtime/state/session_state.py", line 272, in call_callback
    callback(*args, **kwargs)
  File "/home/abdullah/Documents/courses/quran-works/prepare-quran-dataset/frontend/utils.py", line 310, in insert_update_form_submit
    raise e
  File "/home/abdullah/Documents/courses/quran-works/prepare-quran-dataset/frontend/utils.py", line 298, in insert_update_form_submit
    pool.insert(new_item)
  File "/home/abdullah/Documents/courses/quran-works/prepare-quran-dataset/src/prepare_quran_dataset/construct/base.py", line 77, in insert
    raise ItemExistsInPoolError('The item already exists')
prepare_quran_dataset.construct.base.ItemExistsInPoolError: The item already exists