Skip to content

Commit f421be4

Browse files
committed
clean up
1 parent 52bfd4f commit f421be4

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

packages/collection-model/lib/model.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,22 +239,17 @@ const CollectionModel = AmpersandModel.extend(debounceActions(['fetch']), {
239239
if (!shouldFetch(this.status, force)) {
240240
return;
241241
}
242-
// When trying to fetch collectionStats for a namespace whose db does not exist,
243-
// the server throws an error. This happens because we show dbs/collections to
244-
// the user from their roles/privileges. So, if the database does not exist, we
245-
// skip fetching collectionStats for the namespace.
246-
const dbExists = !getParentByType(this, 'Database').is_non_existant;
247242
try {
248243
const newStatus = this.status === 'initial' ? 'fetching' : 'refreshing';
249244
this.set({ status: newStatus });
250245
const [collStats, collectionInfo] = await Promise.all([
251-
dbExists ? dataService.collectionStats(this.database, this.name) : null,
246+
dataService.collectionStats(this.database, this.name),
252247
fetchInfo ? dataService.collectionInfo(this.database, this.name) : null,
253248
]);
254249
this.set({
255250
status: 'ready',
256251
statusError: null,
257-
...(collStats && collStats),
252+
...collStats,
258253
...(collectionInfo && pickCollectionInfo(collectionInfo)),
259254
});
260255
} catch (err) {

packages/data-service/src/data-service.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,11 +1149,15 @@ class DataServiceImpl extends WithLogContext implements DataService {
11491149
);
11501150
} catch (error) {
11511151
const message = (error as Error).message;
1152-
// We ignore errors for fetching collStats when requesting on an
1153-
// unsupported collection type: either a view or a ADF
11541152
if (
1153+
// We ignore errors for fetching collStats when requesting on an
1154+
// unsupported collection type: either a view or a ADF
11551155
message.includes('not valid for Data Lake') ||
1156-
message.includes('is a view, not a collection')
1156+
message.includes('is a view, not a collection') ||
1157+
// When trying to fetch collectionStats for a namespace whose db does not exist,
1158+
// the server throws an error. This happens because we show dbs/collections to
1159+
// the user from their roles/privileges.
1160+
message.includes(`Database [${databaseName}] not found`)
11571161
) {
11581162
return this._buildCollectionStats(databaseName, collectionName, {});
11591163
}

packages/databases-collections-list/src/collections.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const CollectionsList: React.FunctionComponent<{
8282
}) => {
8383
return (
8484
<div className={pageContainerStyles}>
85-
<ItemsGrid<CollectionProps>
85+
<ItemsGrid
8686
namespace={namespace}
8787
items={collections}
8888
itemType="collection"

0 commit comments

Comments
 (0)