enterprise-sdk icon indicating copy to clipboard operation
enterprise-sdk copied to clipboard

Batch endpoint not functioning

Open jcp-issachar-ai opened this issue 2 years ago • 4 comments

  • Factset Formula API:
  • 2.0.0:
  • Python:
  • WSL 2:

Describe the bug Batch processing for the formula api endpoint does not function as expected. Returns '''Invalid type for variable 'data'. Required value type is dict and passed type was list at ['received_data']['data']''' for a valid batch id as input.

To Reproduce Steps to reproduce the behavior:

  1. Generate a valid batch id string using formula api.

  2. Wait till batch status is "DONE'

  3. Use provided get_batch_data code or get_batch_data_with_post examples to get data.

  4. Example: ` with fds.sdk.Formula.ApiClient(configuration) as api_client:

     api_instance = batch_processing_api.BatchProcessingApi(api_client)
    
     id = id # str | Batch Request identifier.
    
     try:
         # Returns the response for a Batch Request
         # example passing only required values which don't have defaults set
         api_response = api_instance.get_batch_data(id)
         responseWrapper = {
             200: api_response.get_response_200,
             202: api_response.get_response_202,
         }
         print(responseWrapper[api_response.status_code]())
    
     except fds.sdk.Formula.ApiException as e:
         print("Exception when calling BatchProcessingApi->get_batch_data: %s\n" % e)`
    

Expected behavior Return a timeseries for the requested batch job.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

jcp-issachar-ai avatar Feb 07 '23 00:02 jcp-issachar-ai

Hi @jcp-issachar-ai, thank you for filing the issue.

We are looking in to this and will get back to you as soon as we can.

granitdula avatar Feb 07 '23 14:02 granitdula

@jcp-issachar-ai We are currently working on a fix for this and will get back to you as soon as that is done.

In the meantime, there is a quick workaround you can use:

api_response = api_instance.get_batch_data(id, _check_return_type=False)

This should give the result your expecting.

Hopefully this helps.

granitdula avatar Feb 08 '23 16:02 granitdula

Thank you. I will try this workaround and get back to you.


From: Granit Dula @.> Sent: Wednesday, February 8, 2023 11:17 AM To: factset/enterprise-sdk @.> Cc: Josh Peterson @.>; Mention @.> Subject: Re: [factset/enterprise-sdk] Batch endpoint not functioning (Issue #14)

We are currently working on a fix for this and will get back to you as soon as that is done.

In the meantime, there is a quick workaround you can use:

api_response = api_instance.get_batch_data(id, _check_return_type=False)

This should give the result your expecting.

Hopefully this helps.

— Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffactset%2Fenterprise-sdk%2Fissues%2F14%23issuecomment-1422881445&data=05%7C01%7C%7Cc2fb1e49791e43d4ee9708db09eff7ff%7C010a97354d864fff9e6402792728ac00%7C0%7C0%7C638114698526070658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EiRr0H24z7OwpTq0EgAwbUZCl9ip7egwxmnezBsiGZ4%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA44SQMD62CTO3QNBC4ALQU3WWPBJNANCNFSM6AAAAAAUTKV52Y&data=05%7C01%7C%7Cc2fb1e49791e43d4ee9708db09eff7ff%7C010a97354d864fff9e6402792728ac00%7C0%7C0%7C638114698526226880%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6FRnBQrIUrBu1H7RNnx0KLdSIey%2BF7BifIQXQ0mF26c%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

jcp-issachar-ai avatar Feb 09 '23 14:02 jcp-issachar-ai

running into this myself as well, more than a year later. workaround seems to work, but :fearful:

zachgrayio avatar Apr 16 '24 19:04 zachgrayio