Skip to content

Commit 75f5f4c

Browse files
committed
style: black samples
1 parent 746b345 commit 75f5f4c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

samples/update_connection_auth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44

55

66
def main():
7-
parser = argparse.ArgumentParser(description="Update a single connection on a datasource or workbook to embed credentials")
7+
parser = argparse.ArgumentParser(
8+
description="Update a single connection on a datasource or workbook to embed credentials"
9+
)
810

911
# Common options
1012
parser.add_argument("--server", "-s", help="Server address", required=True)
1113
parser.add_argument("--site", "-S", help="Site name", required=True)
1214
parser.add_argument("--token-name", "-p", help="Personal access token name", required=True)
1315
parser.add_argument("--token-value", "-v", help="Personal access token value", required=True)
1416
parser.add_argument(
15-
"--logging-level", "-l",
17+
"--logging-level",
18+
"-l",
1619
choices=["debug", "info", "error"],
1720
default="error",
1821
help="Logging level (default: error)",
@@ -36,10 +39,7 @@ def main():
3639
server = TSC.Server(args.server, use_server_version=True)
3740

3841
with server.auth.sign_in(tableau_auth):
39-
endpoint = {
40-
"workbook": server.workbooks,
41-
"datasource": server.datasources
42-
}.get(args.resource_type)
42+
endpoint = {"workbook": server.workbooks, "datasource": server.datasources}.get(args.resource_type)
4343

4444
update_function = endpoint.update_connection
4545
resource = endpoint.get_by_id(args.resource_id)

samples/update_connections_auth.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def main():
2525
parser.add_argument("datasource_username")
2626
parser.add_argument("authentication_type")
2727
parser.add_argument("--datasource_password", default=None, help="Datasource password (optional)")
28-
parser.add_argument("--embed_password", default="true", choices=["true", "false"], help="Embed password (default: true)")
28+
parser.add_argument(
29+
"--embed_password", default="true", choices=["true", "false"], help="Embed password (default: true)"
30+
)
2931

3032
args = parser.parse_args()
3133

@@ -37,10 +39,7 @@ def main():
3739
server = TSC.Server(args.server, use_server_version=True)
3840

3941
with server.auth.sign_in(tableau_auth):
40-
endpoint = {
41-
"workbook": server.workbooks,
42-
"datasource": server.datasources
43-
}.get(args.resource_type)
42+
endpoint = {"workbook": server.workbooks, "datasource": server.datasources}.get(args.resource_type)
4443

4544
resource = endpoint.get_by_id(args.resource_id)
4645
endpoint.populate_connections(resource)
@@ -55,7 +54,7 @@ def main():
5554
authentication_type=args.authentication_type,
5655
username=args.datasource_username,
5756
password=args.datasource_password,
58-
embed_password=embed_password
57+
embed_password=embed_password,
5958
)
6059

6160
print(f"Updated connections on {args.resource_type} {args.resource_id}: {updated_ids}")

0 commit comments

Comments
 (0)