Skip to content

Commit cc869e1

Browse files
Merge branch 'master' into modal
2 parents b66aeb7 + 17f6e56 commit cc869e1

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

apps/hive/src/hive/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def config_validator(user):
7474
from desktop.lib.fsmanager import get_filesystem
7575

7676
if USE_STORAGE_CONNECTORS.get():
77-
from desktop.lib.fs.s3.conf_utils import is_s3_enabled
77+
from desktop.lib.fs.s3.conf_utils import is_enabled as is_s3_enabled
7878
else:
7979
from aws.conf import is_s3_enabled
8080

desktop/core/src/desktop/js/apps/jobBrowser/knockout/JobBrowserViewModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class JobBrowserViewModel {
7676
!this.isMini() && schedulerInterfaceCondition();
7777

7878
const schedulerBeatInterfaceCondition = () =>
79-
this.appConfig()?.scheduler?.interpreter_names.indexOf('celery-beat') !== -1;
79+
this.appConfig()?.scheduler?.interpreter_names.includes('celery-beat');
8080

8181
const livyInterfaceCondition = () =>
8282
!this.isMini() &&

desktop/core/src/desktop/js/apps/storageBrowser/StorageBrowserTab/StorageBrowserTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
8383
error,
8484
reloadData
8585
} = useLoadData<FileStats, { path: string }, AxiosError>(FILE_STATS_API_URL, {
86-
fetchOptions: { isRawError: true },
86+
options: { isRawError: true },
8787
params: { path: filePath },
8888
skip: !filePath
8989
});

desktop/core/src/desktop/js/utils/hooks/useLoadData/useLoadData.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { convertKeysToCamelCase } from '../../../utils/string/changeCasing';
2020

2121
export interface Options<T, U, E> {
2222
params?: U;
23-
fetchOptions?: ApiFetchOptions<T, E>;
23+
options?: ApiFetchOptions<T, E>;
2424
skip?: boolean;
2525
onSuccess?: (data: T) => void;
2626
onError?: (error: E) => void;
@@ -44,7 +44,7 @@ const useLoadData = <T, U = unknown, E = string>(
4444
const [loading, setLoading] = useState<boolean>(false);
4545
const [error, setError] = useState<E>();
4646

47-
const fetchOptionsDefault: ApiFetchOptions<T, E> = {
47+
const optionsDefault: ApiFetchOptions<T, E> = {
4848
silenceErrors: true,
4949
ignoreSuccessErrors: true
5050
};
@@ -72,8 +72,8 @@ const useLoadData = <T, U = unknown, E = string>(
7272
setError(undefined);
7373

7474
const fetchOptions = {
75-
...fetchOptionsDefault,
76-
...localOptions?.fetchOptions
75+
...optionsDefault,
76+
...localOptions?.options
7777
};
7878

7979
try {

desktop/core/src/desktop/lib/fs/s3/core/s3fs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def stats(self, path: Union[str, S3Path]) -> S3Stat:
213213
except FileNotFoundError:
214214
# Check if it's a prefix (directory)
215215
try:
216-
response = self.s3_client.list_objects_v2(Bucket=path.bucket, Prefix=path.key, Delimiter=S3_DELIMITER, MaxKeys=1)
216+
# For directory check, append '/' to avoid matching files that start with same prefix
217+
directory_prefix = path.key.rstrip("/") + "/"
218+
response = self.s3_client.list_objects_v2(Bucket=path.bucket, Prefix=directory_prefix, Delimiter=S3_DELIMITER, MaxKeys=1)
217219
if response.get("CommonPrefixes") or response.get("Contents"):
218220
return S3Stat.for_directory(path)
219221
raise FileNotFoundError(f"Path not found: {path}")

desktop/core/src/desktop/lib/fs/s3/core/upload.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,4 @@ def _get_scheme(self):
209209
if self.destination:
210210
if "://" in self.destination:
211211
return self.destination.split("://")[0].upper()
212-
else:
213-
raise S3ConnectorUploadError("Destination does not have a valid scheme")
214212
return None

0 commit comments

Comments
 (0)