mirror of
https://github.com/diced/zipline.git
synced 2026-06-12 19:01:18 -07:00
feat: add DATASOURCE_S3_FORCE_PATH_STYLE (#658)
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
This commit is contained in:
@@ -156,6 +156,7 @@ export const PROP_TO_ENV = {
|
||||
'datasource.s3.region': 'DATASOURCE_S3_REGION',
|
||||
'datasource.s3.bucket': 'DATASOURCE_S3_BUCKET',
|
||||
'datasource.s3.endpoint': 'DATASOURCE_S3_ENDPOINT',
|
||||
'datasource.s3.forcePathStyle': 'DATASOURCE_S3_FORCE_PATH_STYLE',
|
||||
|
||||
'datasource.local.directory': 'DATASOURCE_LOCAL_DIRECTORY',
|
||||
|
||||
@@ -321,6 +322,7 @@ export function readEnv() {
|
||||
env('datasource.s3.region', 'string'),
|
||||
env('datasource.s3.bucket', 'string'),
|
||||
env('datasource.s3.endpoint', 'string'),
|
||||
env('datasource.s3.forcePathStyle', 'boolean'),
|
||||
|
||||
env('datasource.local.directory', 'string'),
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ export const schema = z.object({
|
||||
region: z.string(),
|
||||
bucket: z.string(),
|
||||
endpoint: z.string().nullable().default(null),
|
||||
forcePathStyle: z.boolean().default(false),
|
||||
})
|
||||
.optional(),
|
||||
local: z
|
||||
|
||||
@@ -24,6 +24,7 @@ export class S3Datasource extends Datasource {
|
||||
region?: string;
|
||||
bucket: string;
|
||||
endpoint?: string | null;
|
||||
forcePathStyle?: boolean;
|
||||
},
|
||||
) {
|
||||
super();
|
||||
@@ -35,6 +36,7 @@ export class S3Datasource extends Datasource {
|
||||
},
|
||||
region: this.options.region ?? undefined,
|
||||
endpoint: this.options.endpoint ?? undefined,
|
||||
forcePathStyle: this.options.forcePathStyle ?? false,
|
||||
});
|
||||
|
||||
this.ensureBucketExists();
|
||||
|
||||
@@ -27,6 +27,7 @@ function getDatasource(conf?: typeof config): void {
|
||||
region: config.datasource.s3?.region,
|
||||
bucket: config.datasource.s3!.bucket,
|
||||
endpoint: config.datasource.s3?.endpoint,
|
||||
forcePathStyle: config.datasource.s3?.forcePathStyle,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user