Package: villaPricingSdk
villaInventorySdkfull docs herehttps://thanakijwanavit.github.io/villa-inventory-sdk/Installpip install villaInventorySdkHow to useUploading a large amount of datasample inputfromvillaPricingSdk.priceimportPricingSdkfromrandomimportrandrangeimportboto3,time,jsonfromdataclassesimportdataclassfromdataclasses_jsonimportdataclass_jsonfromdatetimeimportdatetimeimportpandasaspdfromnicHelper.dictUtilimportprintDictsampleInput=[{'cprcode':9,'brcode':1000,'price':50},{'cprcode':4,'brcode':1000,'price':35},{'cprcode':3,'brcode':1003,'price':36,}]defgetDf(input_:dict):returnpd.DataFrame(input_)df=getDf(sampleInput)df<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}</style>cprcodebrcodeprice091000501410003523100336Upload datainit sdkUpdate price%%timekey='test'r=sdk.uploadDf(df,key=key)ifr.status_code>=400:raiseException(r.json())sdk.ingestData(key=key)signed url is 
url : https://pr
fields
 key : test
 AWSAccessKeyId : ASIAVX4Z5T
 x-amz-security-token : IQoJb3JpZ2
 policy : eyJleHBpcm
 signature : kgDRy1etYA
CPU times: user 44.1 ms, sys: 4.2 ms, total: 48.3 ms
Wall time: 5.47 s





{'body': '{"cprcode":{"0":9,"1":4,"2":3},"brcode":{"0":1000,"1":1000,"2":1003},"price":{"0":50,"1":35,"2":36}}',
 'statusCode': 200,
 'headers': {'Access-Control-Allow-Headers': '*',
  'Access-Control-Allow-Origin': '*',
  'Access-Control-Allow-Methods': '*'}}Query single product%%timesdk.querySingleProduct2(cprcode=1234)succesfully get url, returning pandas
CPU times: user 20.5 ms, sys: 0 ns, total: 20.5 ms
Wall time: 2.69 s<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}</style>cprcodebrcodeprice41234.01000.0123.0Query Branch%%timesdk.branchQuery(1000)---------------------------------------------------------------------------

KeyError                                  Traceback (most recent call last)

<timed eval> in <module>


~/SageMaker/.persisted_conda/python38/lib/python3.8/site-packages/nicHelper/wrappers.py in wrapper(self, *args, **kwargs)
     12         @wraps(func)
     13         def wrapper(self, *args, **kwargs):
---> 14             return func(self, *args, **kwargs)
     15         setattr(cls, func.__name__, wrapper)
     16         # Note we are not binding func, but wrapper which accepts self but does exactly the same as func


~/SageMaker/stacks/villaMaster/villa-master-dev/price/villa-price-sdk/villaPricingSdk/price.py in branchQuery(self, brcode, cprcodes)
    151   })
    152   rawReturn = lambda_.invoke(functionName=self.endpoint.queryBranch(), input = payload)
--> 153   parsedReturn = Response.parseBody(rawReturn)
    154   return pd.read_feather(parsedReturn['url'])
    155 


~/SageMaker/.persisted_conda/python38/lib/python3.8/site-packages/awsSchema/apigateway.py in parseBody(cls, dictInput)
     22   @classmethod
     23   def parseBody(cls, dictInput:dict):
---> 24     response = cls.fromDict(dictInput)
     25     return response.body
     26 


~/SageMaker/.persisted_conda/python38/lib/python3.8/site-packages/awsSchema/apigateway.py in fromDict(cls, dictInput)
     31       dictInput should follow apigateway proxy integration
     32     '''
---> 33     body = dictInput.pop('body')
     34     return cls(
     35       body = json.loads(body),


KeyError: 'body'Query All%%timesdk.queryAll2()succesfully get url, returning pandas
CPU times: user 17.1 ms, sys: 137 µs, total: 17.2 ms
Wall time: 221 ms<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}</style>cprcodebrcodeprice010806.01010.0513.0189190.01028.0869.0241962.01021.0920.0388179.01004.0725.041234.01000.0123.0512345.01000.0345.0619163.01027.0745.0755427.01022.0561.0835004.01002.0625.094.01000.035.0104.01000.035.0114.01000.035.0124.01000.035.0139.01000.050.0149.01000.050.0159.01000.050.0169.01000.050.01723505.01000.0187.0183.01003.036.0193.01003.036.02071386.01017.0470.02169721.01006.0843.0