I can chain these intermediate calls as you suggested but my question is will this result a proper result which is expected with above like of code ?Will it be able to pass that step ?df_filtered_timefilter = df_filtered[(event_start_date <= df_filtered["start_time"]) & (df_filtered["end_time"] <= event_end_date)]Or will these patches will be considered as real df so that the errored line could pass through to next step.
Hi @erlend.vollset I have tried using monkey patch in your suggested pattern for example ts_retrieved1 = { "index":["id","external_id","name","is_string","metadata","unit","asset_id","is_step", "description","security_categories","data_set_id","created_time","last_updated_time"], "value":[3973245479016710,"Brazil:3W:Well-Bore-19B_target_throughput","Brazil:3W:Well-Bore-19B_target_throughput",False,{}, "Barrel",3332326574821917,False,"target volume for a oil well bore",[],8739280581150161,"2023-05-02 09:37:04.944000", "2023-05-02 09:37:04.944000"]} desired_value = pd.DataFrame(ts_retrieved1)mock_to_pandas = MagicMock(return_value=desired_value)mock_get= MagicMock()mock_get.to_pandas = mock_to_pandasmock_timeseries = MagicMock()mock_timeseries.get = MagicMock(return_value=mock_get)mock_retrieve = MagicMock()mock_retrieve.timeseries = MagicMock(return_value=mock_timeseries) mock_client = MagicMock()mock_client.assets.retrieve = MagicMock(return_value=mock_retrieve) Like
Hi @Håkon V. Treider We tried using monkeypatch too , in that we are getting stuck at one line of code which is giving below error TypeError: '<=' not supported between instances of 'int' and 'MagicMock' Code we are using is df_filtered_timefilter = df_filtered[(event_start_date <= df_filtered["start_time"]) & (df_filtered["end_time"] <= event_end_date)]In this event_start_date is mocked but df_filtered is coming as <MagicMock name='mock.assets.retrieve().subtree().events().to_pandas().__getitem__()' id='2821478081008'>Any solution you could recomment for this ?
Hi @Håkon V. Treider could you give detailed example using above code.
Hi @tuan.nguyen , thanks for the reply , i have already tried the same , the issue now is when i retrieve the asset using sdk i can see geolocation updated but when i go to see in CDF UI , i cannot see the same .
Hi @hahmad1 and @Sofie Haug it seems above setting change has worked for me .Thanks for your help :D
Hi @Håkon V. Treider , yes before for some time i had this timezone difference ,i got it solved and then reran the same. From my perspective, in interactive login there is a difference between the usename its getting i.e = jain,vidhi but its expecting vidhi.c.jain@accenture.com which is my mail id . I have registered in cognite-hub using “vidhi.c.jain” as username , Is there any way that i can change my username . Probably then i might be able to login.
Yes @Sofie Haug
Hi @Sofie Haug i have resetted the kernel and reran the cells Throwing same runtime errorhere are some detailed logs may be this might help
Hi @Sofie Haug , i am getting same error in notebook 2_List_Search_Retrieve cmd -5 (c.data_sets.list())
Hi I am facing the same problem, was this issue resolved because i am facing this problem now
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.