Hello Team,
I am trying to list views available in my model, using the function
pdmViewList = client.data_modeling.views.list(space= pdmSpace,all_versions=False, limit=-1)
This runs successfully in Jupyter notebook when I test it, but fails in Streamlit app, I am unable to figure out the reason. Can someone help if I am missing out on anything here?
Below is my code snippet from my app:
import streamlit as st
import pandas as pd
from streamlit.components.v1 import html
from cognite.client import CogniteClient
from MyLibrary import get_pdm_facet
from cognite.client.data_classes.filters import (
Equals,
And,
In,
FilterValueList,
Or,
Prefix
)
from cognite.client.data_classes.data_modeling import (
NodeApply, # node constructor
ViewId, # view reference
DirectRelationReference,
SingleHopConnectionDefinition,
NodeOrEdgeData,
NodeId,
InstancesDeleteResult
)
client = CogniteClient()
# PDM Model Details
pdmModelExternalId = "production_domain_model"
pdmSpace = "slb-pdm-dm-governed"
instanceSpaceGoverned = "slb-pdm-di-governed"
instanceSpaceShared = "slb-pdm-di-shared"
customerSpace = "slb-shaya-di-governed"
pdmModelVersion = "2_0"
pdmViewList = client.data_modeling.views.list(space= pdmSpace,all_versions=False, limit=-1)
st.write(pdmViewList)
this is the error that I am receiving
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/fd16839a-49db-4485-b4d1-c09073faae63.png)
below is the screenshot when I tried to run in Jupyter notebook
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/dacaab62-f08f-4690-b70f-7e2364d351f0.png)