Skip to content
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

fix tao var name #1007

Merged
merged 3 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/co/auto_scale.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/co/ebs_volume.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/co/ec2_instance.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/co/lambda.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/co/rds_database.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/shared/cur.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DatabaseName: "${athena_database_name}"
TableInput:
Name: "${athenaTableName}"
Name: "${athena_table_name}"
Owner: owner
Retention: 0
TableType: EXTERNAL_TABLE
Expand Down
2 changes: 1 addition & 1 deletion cid/builtin/core/data/queries/tao/glue_table.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DatabaseName": "${athena_database_name}",
"TableInput": {
"Name": "${athenaTableName}",
"Name": "${athena_table_name}",
"StorageDescriptor": {
"Location": "${s3FolderPath}",
"Columns": [
Expand Down
1 change: 1 addition & 0 deletions cid/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,7 @@ def get_view_query(self, view_name: str) -> str:
columns_tpl = {
#'athena_datasource_arn': athena_datasource.arn,
'athena_database_name': self.athena.DatabaseName,
'athena_table_name': view_name,
'cur_database': self.cur1.database if cur1_required else None, # for backward compatibly
'cur_table_name': self.cur1.table_name if cur1_required else None, # for backward compatibly
'cur1_database': self.cur1.database if cur1_required else None,
Expand Down
18 changes: 7 additions & 11 deletions cid/helpers/quicksight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,18 @@ def _safe_int(value, default=None):
logger.info(f'Unable to describe template for {dashboardId}, {exc}')
else:
logger.info("Minimum template version could not be found for Dashboard {dashboardId}: {_template_arn}, deployed template could not be described")

if _template_arn is None:
else: # Dashboard is not template based but definition based
try:
dashboard.deployedDefinition = self.describe_dashboard_definition(dashboard_id=dashboardId, refresh=refresh)
except CidError as exc:
logger.info('Exception on reading dashboard definition {dashboardId}: {exc}. Not critical. Continue.')

if 'data' in _definition:
# Resolve source definition (the latest definition publicly available)
data_stream = io.StringIO(_definition["data"])
definition_data = yaml.safe_load(data_stream)
dashboard.sourceDefinition = CidQsDefinition(definition_data)

# Resolve deployed dashboard definition
params = {
"dashboard_id": dashboardId,
"refresh": refresh
}
_deployed_definition = self.describe_dashboard_definition(**params)
# Assign property deployedDefinition to the retrieved dashboard definition
dashboard.deployedDefinition = _deployed_definition

# Fetch datasets (works for both TEMPLATE and DEFINITION based dashboards)
for dataset in dashboard.version.get('DataSetArns', []):
dataset_id = dataset.split('/')[-1]
Expand Down
Loading