I want to use a filter on query_entities for Azure table storage.
I have tried to use filter like this : Table = table_service.query_entities('MyTableName', filter = "RowKey eq 20")
#coding:utf-8
import os
import json
from azure import *
from azure.storage import *
from azure.storage.table import TableService, Entity
table_service = TableService(account_name='MyAccountName',
sas_token='MySASToken')
Table = table_service.query_entities('MyTableName', filter = "Country eq
USA")
print(Table.items)
I got an exception:
azure.common.AzureHttpError: Bad Request {"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"A binary operator with incompatible types was detected. Found operand types 'Edm.String' and 'Edm.Int32' for operator kind 'Equal'.\nRequestId:ef3858e7-5002-00d0-617f-0d374a000000\nTime:2019-05-18T13:45:23.6288160Z"}}}
And I have tried changing to this :
Table = table_service.query_entities('MyTableName', filter = "Country eq
USA")
But I get SyntaxError: invalid syntax