Skip to content

Commit

Permalink
Simplify read text
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Jun 13, 2024
1 parent 8e8e886 commit fc91fae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/databricks/labs/lsql/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ def create_dashboard(self, dashboard_folder: Path) -> Dashboard:
def _get_datasets(dashboard_folder: Path) -> list[Dataset]:
datasets = []
for query_path in sorted(dashboard_folder.glob("*.sql")):
with query_path.open("r") as query_file:
raw_query = query_file.read()
dataset = Dataset(name=query_path.stem, display_name=query_path.stem, query=raw_query)
dataset = Dataset(name=query_path.stem, display_name=query_path.stem, query=query_path.read_text())
datasets.append(dataset)
return datasets

Expand Down

0 comments on commit fc91fae

Please sign in to comment.