Skip to content

Commit 2232919

Browse files
committed
Revert "Fix DataFusion object store registration"
This reverts commit 79a2d0c.
1 parent 530f8c3 commit 2232919

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

RELEASES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ TBD
3030

3131
### Fixes
3232
- Fixed spawned order client_id caching in `ExecAlgorithm`, thanks for reporting @kirill-gr1
33-
- Fixed DataFusion object store registration for custom S3 endpoints (#3120), thanks for reporting @rgauny
34-
- Fixed Binance instrument info dict JSON serialization (#3128), thanks for reporting @woung717
33+
- Fixed Binance instrument info dict JSON serialization, thanks for reporting @woung717
3534
- Fixed Polymarket maker fill order side inversion (#3126), thanks for reporting @santivazq
3635

3736
### Internal Improvements

crates/persistence/src/backend/catalog.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,10 @@ impl ParquetDataCatalog {
940940
// Register the object store with the session for remote URIs
941941
if self.is_remote_uri() {
942942
let url = url::Url::parse(&self.original_uri)?;
943-
944-
// DataFusion requires registration with protocol-level URLs (e.g., "s3://")
945-
// rather than bucket-specific URLs (e.g., "s3://bucket-name")
946-
let base_url = url::Url::parse(&format!("{}://", url.scheme()))?;
943+
let host = url
944+
.host_str()
945+
.ok_or_else(|| anyhow::anyhow!("Remote URI missing host/bucket name"))?;
946+
let base_url = url::Url::parse(&format!("{}://{}", url.scheme(), host))?;
947947
self.session
948948
.register_object_store(&base_url, self.object_store.clone());
949949
}

crates/persistence/src/backend/session.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ impl DataBackendSession {
110110
parsed_uri.scheme(),
111111
"s3" | "gs" | "gcs" | "az" | "abfs" | "http" | "https"
112112
) {
113-
// For cloud storage, register with the generic protocol URL
114-
let base_url = format!("{}://", parsed_uri.scheme());
113+
// For cloud storage, register with the base URL (scheme + netloc)
114+
let base_url = format!(
115+
"{}://{}",
116+
parsed_uri.scheme(),
117+
parsed_uri.host_str().unwrap_or("")
118+
);
115119
let base_parsed_url = Url::parse(&base_url)?;
116120
self.register_object_store(&base_parsed_url, object_store);
117121
}

crates/persistence/tests/test_catalog.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16-
use std::{collections::HashMap, str::FromStr};
16+
use std::str::FromStr;
1717

1818
use nautilus_core::UnixNanos;
1919
use nautilus_model::{
@@ -498,26 +498,6 @@ fn test_register_object_store_from_uri_nonexistent_path() {
498498
assert!(result.is_err());
499499
}
500500

501-
#[rstest]
502-
fn test_register_object_store_from_uri_s3() {
503-
// Test registering remote object store ensures scheme + host base URL parsing succeeds
504-
let mut storage_options = HashMap::new();
505-
storage_options.insert(
506-
"endpoint_url".to_string(),
507-
"https://test.endpoint.com".to_string(),
508-
);
509-
storage_options.insert("region".to_string(), "us-west-2".to_string());
510-
storage_options.insert("access_key_id".to_string(), "test_key".to_string());
511-
storage_options.insert("secret_access_key".to_string(), "test_secret".to_string());
512-
513-
let mut session = DataBackendSession::new(1000);
514-
515-
let result = session
516-
.register_object_store_from_uri("s3://test-bucket/path/to/data", Some(storage_options));
517-
518-
assert!(result.is_ok());
519-
}
520-
521501
#[rstest]
522502
fn test_rust_get_missing_intervals() {
523503
// Arrange

0 commit comments

Comments
 (0)