微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

查询 Azure DevOps Analytics $batch 端点时出现 OData.Feed 错误

如何解决查询 Azure DevOps Analytics $batch 端点时出现 OData.Feed 错误

我已经编写了如下所示的 Power Query:

let
    Source = OData.Feed("https://analytics.dev.azure.com/{org}/{project}/_odata/v3.0-preview/WorkItems?$top=1",null,[Implementation="2.0",OmitValues=ODataOmitValues.Nulls,ODataVersion=4,MaxUriLength=1,EnableBatch=true])
in
    Source

但我收到了一个意外错误

Stack Trace:
Microsoft.Mashup.Host.Document.SerializedException
Microsoft.Mashup.Evaluator.Interface.ErrorException: The method or operation is not implemented. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: The method or operation is not implemented. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: The method or operation is not implemented. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: The method or operation is not implemented. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: The method or operation is not implemented. ---> System.NotImplementedException: The method or operation is not implemented. ---> System.NotImplementedException: The method or operation is not implemented.
   at Microsoft.Mashup.Engine1.Library.OData.HttpRequestBuilder.CreateSingleBatchedODataQuery(MashupHttpWebRequest httpWebRequest,Uri uri,Value innerRequestHeaders,String contentType,ODataServerVersion version)
   at Microsoft.Mashup.Engine1.Library.OData.HttpRequestBuilder.BuildWebRequest(HttpResource resource,Uri serviceUri,Value headers,ResourceCredentialCollection credentials,ODataSettingsBase settings,IEngineHost host,ODataUserSettings userSettings,ODataServerVersion serverVersion)
   at Microsoft.Mashup.Engine1.Library.OData.ODataRequest.BuildWebRequest(IResource origin,IResource& resource)
   at Microsoft.Mashup.Engine1.Library.Web.Request.ManualRedirect(IEngineHost host,String resourceKind,CreateWebRequestDelegate createRequest,Func`2 createResponse,WebRequest& webRequest,Int32[] nonErrors)
   at Microsoft.Mashup.Engine1.Library.OData.ODataRequest.<>c__displayClass23_0.<GetResponseStream>b__0()
   at Microsoft.Mashup.Engine1.Library.Common.RetryPolicy.Execute[TResult](IEngineHost host,Func`1 func)
   at Microsoft.Mashup.Engine1.Library.OData.ODataRequest.GetResponseStream(IHostTrace trace,String key,Boolean tokenRefreshed)
   at Microsoft.Mashup.Engine1.Library.OData.ODataRequest.GetResponseStream()
   at Microsoft.Mashup.Engine1.Library.OData.ODataModule.<>c__displayClass13_0.<TryDetectODataV4Feed>b__0()
   at Microsoft.Mashup.Engine1.Library.OData.ODataFallbackVersionHandler.HandLeversionFallback[T](Func`1 function,Boolean throwOnBadRequest)
   at Microsoft.Mashup.Engine1.Library.OData.ODataModule.TryDetectODataV4Feed(HttpResource resource,StandaloneODataFallbackVersionHandler fallbackHandler,HttpResponseData& responseData)
   at Microsoft.Mashup.Engine1.Library.OData.ODataModule.GetFeed(HttpResource resource,TextValue serviceUriValue,TextValue uriValue,Boolean useCachedCredentials)
   at Microsoft.Mashup.Engine1.Library.OData.ODataModule.FeedFunctionValue.TypedInvoke(TextValue serviceUri,Value options)
   at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3`4.Invoke(Value arg0,Value arg1,Value arg2)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Runtime.Library.Linker.BindFunctionValue.TypedInvoke(RecordValue environment,Value section,TextValue name)
   at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3`4.Invoke(Value arg0,Value arg2)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
   at Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.Instruction.ExecuteCondition(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.ExecuteCondition(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.IfInstruction.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
   at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters,Action`1 callback)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters,Action`1 callback)
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters,Action`1 callback)
   at Microsoft.Mashup.Evaluator.Interface.IDocumentEvaluatorExtensions.GetResult[T](IDocumentEvaluator`1 evaluator,DocumentEvaluationParameters parameters)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel,BeginGetResultMessage message,Action`1 action)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel,BeginGetPreviewValueSourceMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Trydispatch(IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.Trydispatch(IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.dispatch(IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnkNownChannel(IMessageChannel baseChannel,MessageWithUnkNownChannel messageWithUnkNownChannel)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Trydispatch(IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__displayClass9_0.<CreateAction>b__0(Object o)
   at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.<>c__displayClass3_0.<BeginGetResult>b__0(EvaluationResult2`1 result)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.<>c__displayClass3_0.<BeginGetResult>b__0(EvaluationResult2`1 result)
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters,Message message)
   at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__displayClass9_0.<CreateAction>b__0(Object o)
   at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__displayClass9_1.<OnBeginGetPreviewValueSource>b__1()
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__displayClass0_0.<RunStub>b__0()
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace,IEngineHost engineHost,IMessageChannel channel,Action action)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__displayClass11_0.<TryReportException>b__1()
   at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host,IHostTrace trace,Action action)
   at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace,Exception exception)
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace,Action action)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost,Func`1 getPreviewValueSource)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__displayClass12_1`1.<OnBeginGetResult>b__0()
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace,Action action)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__displayClass9_0.<CreateAction>b__0(Object o)
   at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost,ExceptionMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Trydispatch(IMessageChannel channel,Message message)
   at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition,Boolean disposing)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_TableSource()
   at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_TableSource()
   at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result,Func`1 getStaleSince,Func`1 getSampled)

我设置了 MaxUriLength=1 以强制它使用 $batch 端点,但是当我没有设置它并且我的查询更长时会出现同样的问题。此外,如果我不设置 MaxUriLength=1 并且我使用较短的查询,我不会收到任何错误并且查询工作正常。根据{{​​3}}:

$batch 端点不适用于项目范围,但批处理中的查询可以包含项目范围。

我不知道如何在 Power Query 中表达它。提前致谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。