How to use the azure-cosmosdb-table.azure.cosmosdb.table.common.models._unicode_type function in azure-cosmosdb-table

To help you get started, we’ve selected a few azure-cosmosdb-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / _serialization.py View on Github external
def _get_request_body(request_body):
    '''Converts an object into a request body.  If it's None
    we'll return an empty string, if it's one of our objects it'll
    convert it to XML and return it.  Otherwise we just use the object
    directly'''
    if request_body is None:
        return b''

    if isinstance(request_body, bytes) or isinstance(request_body, IOBase):
        return request_body

    if isinstance(request_body, _unicode_type):
        return request_body.encode('utf-8')

    request_body = str(request_body)
    if isinstance(request_body, _unicode_type):
        return request_body.encode('utf-8')

    return request_body
github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / _serialization.py View on Github external
def _get_request_body(request_body):
    '''Converts an object into a request body.  If it's None
    we'll return an empty string, if it's one of our objects it'll
    convert it to XML and return it.  Otherwise we just use the object
    directly'''
    if request_body is None:
        return b''

    if isinstance(request_body, bytes) or isinstance(request_body, IOBase):
        return request_body

    if isinstance(request_body, _unicode_type):
        return request_body.encode('utf-8')

    request_body = str(request_body)
    if isinstance(request_body, _unicode_type):
        return request_body.encode('utf-8')

    return request_body
github Azure / azure-cosmos-table-python / azure-cosmosdb-table / azure / cosmosdb / table / common / _common_conversion.py View on Github external
def _decode_base64_to_bytes(data):
    if isinstance(data, _unicode_type):
        data = data.encode('utf-8')
    return base64.b64decode(data)

azure-cosmosdb-table

Microsoft Azure CosmosDB Table Client Library for Python

Apache-2.0
Latest version published 5 years ago

Package Health Score

55 / 100
Full package analysis

Popular azure-cosmosdb-table functions

Similar packages