Skip to content

insert_table_entity bug certain characters fail with 400 error #7

@SPFL-Analysis

Description

@SPFL-Analysis

Hello,

I am using table storage and getting a 400 error when using insert_table_entity to try and insert an entity with property of type string that contains a £ sign. Although I don't get the error when using import_table_entities. Example below, any help welcome.
(Using R v4.3.3 on windows and latest available versions of all packages)

Thanks.

key <- "<key>"
tblendpoint <- "<endpoint>"
tblname <- "<tblname>"

df <- data.frame(
  PartitionKey = rep("testtbl", 2),
  RowKey = as.character(1:2),
  Mystring = c("text", "£")
)

endp <- AzureTableStor::table_endpoint(tblendpoint, key = key)
AzureTableStor::create_storage_table(endp, tblname)
tab <- AzureTableStor::storage_table(endp, tblname)

AzureTableStor::import_table_entities(tab, data = df)

tblDl <- try(AzureTableStor::list_table_entities(tab))

testOk <- list(
  PartitionKey = "testtbl",
  RowKey = "3",
  Mystring = "some text"
)

AzureTableStor::insert_table_entity(tab, testOk)

# this will fail with a 400 error
testFail <- list(
  PartitionKey = "testtbl",
  RowKey = "6",
  Mystring = "some text with key <- "<key>"
tblendpoint <- "<endpoint>"
tblname <- "<tblname>"

df <- data.frame(
  PartitionKey = rep("testtbl", 2),
  RowKey = as.character(1:2),
  Mystring = c("text", "£")
)

endp <- AzureTableStor::table_endpoint(tblendpoint, key = key)
AzureTableStor::create_storage_table(endp, tblname)
tab <- AzureTableStor::storage_table(endp, tblname)

AzureTableStor::import_table_entities(tab, data = df)

tblDl <- try(AzureTableStor::list_table_entities(tab))

testOk <- list(
  PartitionKey = "testtbl",
  RowKey = "3",
  Mystring = "some text"
)

AzureTableStor::insert_table_entity(tab, testOk)

# this will fail with a 400 error
testFail <- list(
  PartitionKey = "testtbl",
  RowKey = "6",
  Mystring = "some text with £"
)

AzureTableStor::insert_table_entity(tab, testFail)"
)

AzureTableStor::insert_table_entity(tab, testFail)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions