BlueBrain / BlueBrain/nexus-python-sdk

Resources update function results in Python HTTP request InvalidSchema error

未关闭
#47 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
6
派生
10
PR 合并指标
30 天内没有已合并 PR

描述

I am calling nexussdk.resources.update on a resource created on Nexus sandbox (nexus-sandbox.io), and the function results in HTTP request results in InvalidSchema error: "No connection adapters were found for 'base:?rev=1'"

Here is the instance object that is used to send the request:

OrderedDict([('@context', ['https://nexus-sandbox.io/v1/resources/kcnitest/redcap/_/medredcontexttest10']), ('@id', 'initial_appointmen_arm_1'), ('_self', 'base:initial_appointmen_arm_1'), ('_constrainedBy', 'https://bluebrain.github.io/nexus/schemas/unconstrained.json'), ('_project', 'https://nexus-sandbox.io/v1/projects/kcnitest/redcap'), ('_rev', 1), ('_deprecated', False), ('_createdAt', '2019-02-12T15:53:26.937Z'), ('_createdBy', 'https://nexus-sandbox.io/v1/realms/github/users/ehsanmaag'), ('_updatedAt', '2019-02-12T15:53:26.937Z'), ('_updatedBy', 'https://nexus-sandbox.io/v1/realms/github/users/ehsanmaag'), ('title', 'Initial Appointment'), ('medred:includesInstrument', ['ex:patient_health_questionnaire_9'])])

It seems the reason is that instance["_self"] does not contain the full request URL.
How can we resolve that?

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 nexussdk.resources.update 开始,使用 issue 中显示的实例对象重现请求。跟踪 _self 值(尤其是 base:initial_appointmen_arm_1 形式)如何变成请求 URL;当更新 Nexus sandbox 中创建的资源时不再引发 InvalidSchema,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。