Incorrect metadata parsing for attributes with sap prefix
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 42/100
Línea de trabajo
Inspecciona pyodata/v2/model.py alrededor de la línea 2483 y compara el URI del namespace sap configurado con el URI de los metadatos proporcionados. Reproduce el problema usando los metadatos de JobApplicationSnapshot_FuncExperience y verifica que applicationId exponga los valores esperados de label, creatable, updatable, visible, sortable y filterable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I am using this to extract metadata when I realized the sap prefixed attributes are not coming through accurately.
Pyodata version: 1.7.0
XML metadata from API for Entity Type JobApplicationSnapshot_FuncExperience
Api call: https://api4.successfactors.com/odata/v2/JobApplicationSnapshot_FuncExperience/$metadata
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:atom="http://www.w3.org/2005/Atom">
<edmx:DataServices m:DataServiceVersion="2.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<Schema Namespace="SFODataSet" xmlns="http://schemas.microsoft.com/ado/2008/09/edm" xmlns:sf="http://www.successfactors.com/edm/sf" xmlns:sap="http://www.successfactors.com/edm/sap">
<EntityContainer Name="EntityContainer" m:IsDefaultEntityContainer="true">
<EntitySet Name="JobApplicationSnapshot_FuncExperience" EntityType="SFOData.JobApplicationSnapshot_FuncExperience" sap:label="JobApplicationSnapshot_FuncExperience" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:deletable="false">
<Documentation>
<Summary>Candidate Background</Summary>
<LongDescription>These entities represent the background elements as defined in the candidate template. For example:CandidateBackground_Certificate, CandidateBackground_Education, etc</LongDescription>
<sap:tagcollection>
<sap:tag>Recruiting (RCM)</sap:tag>
<sap:tag>RCM - Candidate</sap:tag>
</sap:tagcollection>
</Documentation>
</EntitySet>
</EntityContainer>
</Schema>
<Schema Namespace="SFOData" xmlns="http://schemas.microsoft.com/ado/2008/09/edm" xmlns:sf="http://www.successfactors.com/edm/sf" xmlns:sap="http://www.successfactors.com/edm/sap">
<EntityType Name="JobApplicationSnapshot_FuncExperience">
<Key>
<PropertyRef Name="backgroundElementId"></PropertyRef>
</Key>
<Property Name="applicationId" Type="Edm.Int64" Nullable="false" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="true" sap:label="Application Id"></Property>
<Property Name="backgroundElementId" Type="Edm.Int64" Nullable="false" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="true" sap:label="Background Element Id"></Property>
<Property Name="bgOrderPos" Type="Edm.Int64" Nullable="false" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="false" sap:label="Background Order Position"></Property>
<Property Name="function1" Type="Edm.String" Nullable="false" sap:required="true" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="false" sap:picklist="func_exp" sap:label="Experience Type"></Property>
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" Nullable="false" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="true" sap:label="Last Modified Date"></Property>
<Property Name="startDate" Type="Edm.DateTime" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="false" sap:display-format="Date" sap:label="As of Date"></Property>
<Property Name="yearsExp" Type="Edm.Double" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="false" sap:filterable="false" sap:label="Years of Experience (Number)"></Property>
</EntityType>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Here's the code to reproduce the error for above entity:
In [29]: import requests, pyodata
In [30]: session = requests.Session()
In [31]: session.auth = ("username", "password")
In [32]: SERVICE_URL = "https://api4.successfactors.com/odata/v2"
In [33]: service = pyodata.Client(SERVICE_URL, session)
In [34]: p = service.schema.entity_type("JobApplicationSnapshot_FuncExperience").proprty("applicationId")
In [35]: print(f"label={p.label}, updatable={p.updatable}, creatable={p.creatable}, visible={p.visible}, sortable={p.sortable}, filterable={p.filterable}")
label=None, updatable=True, creatable=True, visible=True, sortable=True, filterable=True
Expected Output:
label=Application Id, updatable=False, creatable=False, visible=True, sortable=False, filterable=True
After digging into the code, I believe the issue is here. The uri for prefix sap that I see in the raw XML data (as shown above) is http://www.successfactors.com/edm/sap.
Apologies if I am missing something obvious here. I am still fairly new to XML and successfactors api.
- Lenguaje dominante
- Python
- Estrellas
- 268
- Forks
- 100
- Merge medio
- 5 d 1 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SAP/python-pyodata
-
fromisotime cleanup when 3.11 is Python miniumumPosiblemente ocupada @phanak-sap la tomó hace 4 días. Abiertochore
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SAP/python-pyodata#304 · 1 asignado ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SAP/python-pyodata#108 ·
-
chore: refactorings for Python 3.10 as minimum versionQuizá libre de nuevo @phanak-sap la tomó hace 100 días y no hay ningún pull request abierto. Abiertochore
SAP/python-pyodata#302 · 1 asignado ·
-
Unable to get the link rel='delta' when using getEntities() with Delta ServiceQuizá libre de nuevo @phanak-sap la tomó hace 339 días y no hay ningún pull request abierto. Abiertoquestion
SAP/python-pyodata#294 · 1 comentario · 1 asignado ·
-
Incorrect escaping of pathQuizá libre de nuevo @phanak-sap la tomó hace 738 días y no hay ningún pull request abierto. Abiertobug
SAP/python-pyodata#282 · 2 comentarios · 1 asignado ·
Todos los issues de SAP/python-pyodata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-2 días Aptitud para principiantes 70/100
-
FingerprintSplitter raises ZeroDivisionError when int(frac_train * len(dataset)) floors to zeroAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 7 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
lmstudio-ai/mlx-engine#376 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pyiron/bagofholding#166 ·