Pregunta

Using the Python SDK for VersionOne, I'm trying to sum the actuals for each task. Here's my best guess at how to do this.

term="Actuals:Actual.Value.@Sum"

for task in v1.Task.select("Name",term).filter("AssetState!='Dead'"):
    print(task.Name,task.data[term])

First, the task.data[term] bit is based on the docs, but there's no such key. The closest key in the returned task is "Actuals:Actual".

Second, using that as the key instead seems to work for tasks that have no actuals, although instead of "0", I get an empty string.

Finally, once I hit a task with some actuals, I get an AttributeError in v1pysdk.v1meta.add_attribute_to_output(), which is somehow using "6" (the actual actual) as a base_asset, calling its with_data() method.

I'm able to get these sums using, e.g.,

<server-base>/rest-1.v1/Data/Task/1234/Actuals:Actual.Value.@Sum

so surely I'm close. Is there a way to do this with the Python SDK?

Thanks.

¿Fue útil?
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top