When repeatedly reloading a Streamlit application, classes should not be registered multiple times in the neomodel library in order to avoid a NodeClassAlreadyDefined exception. The application should be executed without errors, even if it is reloaded several times.
Actual Behavior (Mandatory)
When the Streamlit page is reloaded, a NodeClassAlreadyDefined exception occurs because the classes are registered again. This leads to an error and prevents the application from continuing to run.
How to Reproduce the Problem
Create a simple Streamlit application that uses neomodel classes.
Reload the Streamlit page several times.
Observe that a NodeClassAlreadyDefined exception is thrown on each reload.
Simple Example
import streamlit as st
from neomodel import StructuredNode, StringProperty, UniqueIdProperty, config
config.DATABASE_URL = 'bolt://neo4j:neo4j@localhost:7687'
class Component(StructuredNode):
uid = UniqueIdProperty()
name = StringProperty(unique_index=True)
version = StringProperty()
st.write("This is a test application")
Expected Behavior (Mandatory)
When repeatedly reloading a Streamlit application, classes should not be registered multiple times in the neomodel library in order to avoid a
NodeClassAlreadyDefined
exception. The application should be executed without errors, even if it is reloaded several times.Actual Behavior (Mandatory)
When the Streamlit page is reloaded, a
NodeClassAlreadyDefined
exception occurs because the classes are registered again. This leads to an error and prevents the application from continuing to run.How to Reproduce the Problem
Create a simple Streamlit application that uses neomodel classes. Reload the Streamlit page several times. Observe that a NodeClassAlreadyDefined exception is thrown on each reload.
Simple Example
Screenshots (where it's possibile)
Specifications (Mandatory)
Currently used versions
Versions