-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elide namespace support #1509
Elide namespace support #1509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have more of a service around dataSources instead of relying directly on config.navi.dataSources
. Then we could do stuff like fetch all the namespaces from an elide datasource automatically rather than configuring each namespace manually
@@ -23,6 +23,14 @@ | |||
"uri": "http://localhost:8080/graphql/api/v1", | |||
"type": "elide", | |||
"suggestedDataTables": [] | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we model namespaces like this:
{
"name": "corpAnalytics",
"type": "elide",
"uri": "http://localhost:8080/graphql/api/v1",
"displayName": "Corp Analytics - General", // for default namespace
"suggestedDataTables": [] // for default namespace
"namespaces": [{
"name": "rev",
"displayName": "Revenue",
"suggestedDataTables": ["allRevenue"]
}]
},
Then the datasource id for namespaces can be something like:
corpAnalytics.default
corpAnalytics.rev
Yeah @jkusa had similar feedback (in addition to his comment above) and said we can address that in a separate PR. I thought we wanted to explicitly configure which namespaces we want to use. |
throw new Error(`Datasource ${dataSourceName} should be configured in the navi environment`); | ||
if (lookupNamespace) { | ||
const namespace = dataSource.namespaces?.find(({ name }) => name === lookupNamespace); | ||
if (!namespace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we store elideOne.default
as a data source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, just elideOne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one comment
uri: string; | ||
options?: Options; | ||
namespaces?: DataSourceNamespace[]; | ||
suggestedDataTables?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move suggestedDataTables
to DataSourceNamespace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestedDataTables?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I did initially, I just bumped it to the root level because in the future we're not going to have namespaces
at all and we'll have to somehow define all suggested tables at the root level
But yeah maybe for now it makes more sense to have it in DataSourceNamespace
return yield sortBy(sources, ['name']); | ||
} | ||
|
||
@task *fetchDataSourceNamespaces(dataSource: NaviDataSource): TaskGenerator<SourceItem<NaviDataSource>[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long term it would be good to have this layer not know about namespaces. We can just process the original data sources with nested namespaces and generate a single flat list of data sources
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, like you and @kevinhinterlong suggested we should maybe have a service around that to discover namespaces and flatten
uri: string; | ||
options?: Options; | ||
namespaces?: DataSourceNamespace[]; | ||
suggestedDataTables?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestedDataTables?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one comment otherwise 👍
Description
Add support for Elide namespaces https://elide.io/pages/guide/v6/04-analytics.html#namespaces
Proposed Changes
WS:
namespaces
list to theDataSource
modelDemoNamespace
and a new tableTrendingNow
that belongs to that namespace (same physical base table)UI:
GetTables
andGetTable
friendlyName
asname
Screenshots
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.