forked from amundsen-io/amundsen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
other: Add Dashboard sample data (amundsen-io#292)
* Add Dashboard sample data * Update
- Loading branch information
1 parent
a430e1f
commit 22e26e8
Showing
10 changed files
with
145 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
databuilder/databuilder/transformer/generic_transformer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
|
||
from pyhocon import ConfigTree # noqa: F401 | ||
from typing import Any, Dict # noqa: F401 | ||
|
||
from databuilder.transformer.base_transformer import Transformer | ||
|
||
CALLBACK_FUNCTION = 'callback_function' | ||
FIELD_NAME = 'field_name' | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class GenericTransformer(Transformer): | ||
""" | ||
A generic transformer that accepts a callback function that transforms the record on specified field. | ||
""" | ||
|
||
def init(self, conf): | ||
# type: (ConfigTree) -> None | ||
self._callback_function = conf.get(CALLBACK_FUNCTION) | ||
self._field_name = conf.get_string(FIELD_NAME) | ||
|
||
def transform(self, record): | ||
# type: (Dict[str, Any]) -> Dict[str, Any] | ||
|
||
for k, v in record.items(): | ||
if k == self._field_name: | ||
new_val = self._callback_function(v) | ||
record[k] = new_val | ||
return record | ||
|
||
def get_scope(self): | ||
# type: () -> str | ||
return 'transformer.generic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
product,cluster,dashboard_group,dashboard_group_id,dashboard_group_description,dashboard_group_url,dashboard_name,dashboard_id,description,created_timestamp,dashboard_url | ||
mode,gold,test group1,test_group_id_1,test group description 1,http://mode.test_group_id_1.com,test dashboard,test_dashboard_id_1,test dashboard description,1592333799,http://mode.test_group_id_1.com/test_dashboard_id_1 | ||
mode,gold,test group1,test_group_id_1,test group description 1_2,http://mode.test_group_id_1.com,test dashboard,test_dashboard_id_1_2,test dashboard description 1_2,1592332799,http://mode.test_group_id_1.com/test_dashboard_id_1_2 | ||
mode,gold,test group2,test_group_id_2,test group description 2,http://mode.test_group_id_2.com,test dashboard,test_dashboard_id_2,test dashboard description,1592133799,http://mode.test_group_id_2.com/test_dashboard_id_2 | ||
superset,gold,test group3,test_group_id_3,test group description 1,http://mode.test_group_id_3.com,test dashboard,test_dashboard_id_3,test dashboard description,1591333799,http://mode.test_group_id_3.com/test_dashboard_id_3 |
5 changes: 5 additions & 0 deletions
5
databuilder/example/sample_data/sample_dashboard_last_execution.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,execution_id,execution_timestamp,execution_state | ||
mode,gold,test_group_id_1,test_dashboard_id_1,_last_successful_execution,1592351193,success | ||
mode,gold,test_group_id_2,test_dashboard_id_2,_last_successful_execution,1592351210,success | ||
mode,gold,test_group_id_1,test_dashboard_id_1,_last_execution,1593351193,fail | ||
mode,gold,test_group_id_2,test_dashboard_id_2,_last_execution,1594351210,success |
3 changes: 3 additions & 0 deletions
3
databuilder/example/sample_data/sample_dashboard_last_modified.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,last_modified_timestamp | ||
mode,gold,test_group_id_1,test_dashboard_id_1,1592351454 | ||
mode,gold,test_group_id_2,test_dashboard_id_2,1592311423 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,email | ||
mode,gold,test_group_id_1,test_dashboard_id_1,roald.amundsen@example.org | ||
mode,gold,test_group_id_2,test_dashboard_id_2,buzz@example.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,query_name,query_id,url,query_text | ||
mode,gold,test_group_id_1,test_dashboard_id_1,first query,query_1,http://mode.test_group_id_1.com/test_dashboard_id_1/query/query_1,SELECT * FROM foo.bar | ||
mode,gold,test_group_id_2,test_dashboard_id_2,second query,query_2,http://mode.test_group_id_2.com/test_dashboard_id_2/query/query_2,SELECT * FROM bar.foo JOIN foo.bar USING (baz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,table_ids | ||
mode,gold,test_group_id_1,test_dashboard_id_1,"hive://gold.test_schema/test_table1" | ||
mode,gold,test_group_id_2,test_dashboard_id_2,"hive://gold.test_schema/test_view1,hive://gold.test_schema/test_table3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
product,cluster,dashboard_group_id,dashboard_id,view_count,email | ||
mode,gold,test_group_id_1,test_dashboard_id_1,100,roald.amundsen@example.org | ||
mode,gold,test_group_id_2,test_dashboard_id_2,2000,chrisc@example.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters