# Spark Connect to S3

**URL:** <https://discourse.greatexpectations.io/t/spark-connect-to-s3/925>\
**Category:** GX Core Support\
**Tags:** s3\
**Created:** [November 9, 2021, 1:09am UTC](https://discourse.greatexpectations.io/t/spark-connect-to-s3/925 "2021-11-09T01:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavy](https://avatars.discourse-cdn.com/v4/letter/x/e0b2c6/32.png) [@xavy](https://discourse.greatexpectations.io/u/xavy)\
**Post date:** [November 9, 2021, 1:09am UTC](https://discourse.greatexpectations.io/t/spark-connect-to-s3/925/1 "2021-11-09T01:09:21Z")

</div>

Hi All,

I’m using InferredAssetS3DataConnector to connect to S3, but it is not working returning a message “ValueError: S3 query may not have been configured correctly.”  
After debug your code I found a bug related to prefix transformation, in the line:

```auto
self._prefix = os.path.join(prefix, "")

```

That line adds a trailing slash to the prefix, you can easily replicate the issue using the code:

```auto
import os
prefix = "weather.csv"

prefix_new = os.path.join(prefix, "")
print(prefix_new) 

```

It returns weather.csv/ instead of weather.csv as expected…  
The same issue occurs in the class “ConfiguredAssetS3DataConnector”, can you please consider change it to:

```auto
self._bucket = bucket
*self._prefix = os.path.join(prefix, "") # causes the issue*
*self._prefix = prefix # potential solution*
self._delimiter = delimiter
self._max_keys = max_keys

```

Can you please take a look and fix it in the next release?

With Best Regards  
Xavier
