@@ -277,3 +277,51 @@ def test_raw_empty_schema_binding(self, kikimr, client, unique_prefix):
277
277
assert "Only one column in schema supported in raw format" in str (binding_response .issues ), str (
278
278
binding_response .issues
279
279
)
280
+
281
+ @yq_all
282
+ @pytest .mark .parametrize ("client" , [{"folder_id" : "my_folder" }], indirect = True )
283
+ def test_binding_with_backslash_in_location (self , s3 , client , unique_prefix ):
284
+ resource = boto3 .resource (
285
+ "s3" , endpoint_url = s3 .s3_url , aws_access_key_id = "key" , aws_secret_access_key = "secret_key"
286
+ )
287
+
288
+ bucket = resource .Bucket ("backslash_bucket" )
289
+ bucket .create (ACL = 'public-read' )
290
+
291
+ s3_client = boto3 .client (
292
+ "s3" , endpoint_url = s3 .s3_url , aws_access_key_id = "key" , aws_secret_access_key = "secret_key"
293
+ )
294
+
295
+ data = R'''data
296
+ test'''
297
+ s3_client .put_object (Body = data , Bucket = 'backslash_bucket' , Key = '\\ ' , ContentType = 'text/plain' )
298
+
299
+ connection_response = client .create_storage_connection (unique_prefix + "backslash_bucket" , "backslash_bucket" )
300
+
301
+ data_type = ydb .Column (name = "data" , type = ydb .Type (type_id = ydb .Type .PrimitiveTypeId .UTF8 ))
302
+ storage_binding_name = unique_prefix + "binding_name"
303
+ client .create_object_storage_binding (
304
+ name = storage_binding_name ,
305
+ path = "\\ " ,
306
+ format = "csv_with_names" ,
307
+ connection_id = connection_response .result .connection_id ,
308
+ columns = [data_type ],
309
+ )
310
+
311
+ sql = fR'''
312
+ SELECT *
313
+ FROM bindings.{ storage_binding_name } ;
314
+ '''
315
+
316
+ query_id = client .create_query (
317
+ "simple" , sql , type = fq .QueryContent .QueryType .ANALYTICS , pg_syntax = True
318
+ ).result .query_id
319
+ client .wait_query_status (query_id , fq .QueryMeta .COMPLETED )
320
+
321
+ data = client .get_result_data (query_id )
322
+ result_set = data .result .result_set
323
+ logging .debug (str (result_set ))
324
+ assert len (result_set .columns ) == 1
325
+ assert result_set .columns [0 ].name == "data"
326
+ assert len (result_set .rows ) == 1
327
+ assert result_set .rows [0 ].items [0 ].text_value == "test"
0 commit comments