-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature flags usage to info and telemetry (#1042)
- Loading branch information
1 parent
d08be66
commit 6e5f8b2
Showing
9 changed files
with
70 additions
and
25 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
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
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,18 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
|
||
def try_cast_to_bool(value: Any) -> bool: | ||
if isinstance(value, bool): | ||
return value | ||
|
||
# Now if value is not string then cast it to str. Simplifies logic for 1 and 0 | ||
if not isinstance(value, str): | ||
value = str(value) | ||
|
||
know_booleans_mapping = {"true": True, "false": False, "1": True, "0": False} | ||
|
||
if value.lower() not in know_booleans_mapping: | ||
raise ValueError(f"Could not case {value} to bool value") | ||
return know_booleans_mapping[value.lower()] |
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
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
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
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 |
---|---|---|
|
@@ -12,17 +12,6 @@ | |
|
||
''' | ||
# --- | ||
# name: test_execute[@db.schema.repo/branches/main/[email protected]/branches/main/-expected_files0] | ||
''' | ||
SUCCESS - @db.schema.repo/branches/main/s1.sql | ||
+--------------------------------------------------------+ | ||
| File | Status | Error | | ||
|--------------------------------------+---------+-------| | ||
| @db.schema.repo/branches/main/s1.sql | SUCCESS | None | | ||
+--------------------------------------------------------+ | ||
|
||
''' | ||
# --- | ||
# name: test_execute[@db.schema.repo/branches/main/[email protected]/branches/main/-expected_files3] | ||
''' | ||
SUCCESS - @db.schema.repo/branches/main/s1.sql | ||
|
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
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