@@ -90,9 +90,7 @@ def datasource_new(directory):
90
90
datasource_name , data_source_type = add_datasource (context )
91
91
92
92
if datasource_name :
93
- cli_message (
94
- "A new datasource '{}' was added to your project." .format (datasource_name )
95
- )
93
+ cli_message (f"A new datasource '{ datasource_name } ' was added to your project." )
96
94
toolkit .send_usage_message (
97
95
data_context = context , event = "cli.datasource.new" , success = True
98
96
)
@@ -118,9 +116,7 @@ def delete_datasource(directory, datasource):
118
116
context .delete_datasource (datasource )
119
117
except ValueError :
120
118
cli_message (
121
- "<red>{}</red>" .format (
122
- "Datasource {} could not be found." .format (datasource )
123
- )
119
+ "<red>{}</red>" .format (f"Datasource { datasource } could not be found." )
124
120
)
125
121
sys .exit (1 )
126
122
try :
@@ -404,7 +400,7 @@ def _add_pandas_datasource(
404
400
errors = DatasourceConfigSchema ().validate (configuration )
405
401
if len (errors ) != 0 :
406
402
raise ge_exceptions .GreatExpectationsError (
407
- "Invalid Datasource configuration: {:s}" . format ( errors )
403
+ f "Invalid Datasource configuration: { errors :s} "
408
404
)
409
405
410
406
cli_message (
@@ -457,7 +453,7 @@ def _add_sqlalchemy_datasource(context, prompt_for_datasource_name=True):
457
453
success = True ,
458
454
)
459
455
460
- datasource_name = "my_{}_db" . format ( selected_database .value .lower ())
456
+ datasource_name = f "my_{ selected_database .value .lower ()} _db"
461
457
if selected_database == SupportedDatabases .OTHER :
462
458
datasource_name = "my_database"
463
459
if prompt_for_datasource_name :
@@ -533,7 +529,7 @@ def _add_sqlalchemy_datasource(context, prompt_for_datasource_name=True):
533
529
errors = DatasourceConfigSchema ().validate (configuration )
534
530
if len (errors ) != 0 :
535
531
raise ge_exceptions .GreatExpectationsError (
536
- "Invalid Datasource configuration: {:s}" . format ( errors )
532
+ f "Invalid Datasource configuration: { errors :s} "
537
533
)
538
534
539
535
cli_message (
@@ -898,7 +894,7 @@ def _add_spark_datasource(
898
894
errors = DatasourceConfigSchema ().validate (configuration )
899
895
if len (errors ) != 0 :
900
896
raise ge_exceptions .GreatExpectationsError (
901
- "Invalid Datasource configuration: {:s}" . format ( errors )
897
+ f "Invalid Datasource configuration: { errors :s} "
902
898
)
903
899
904
900
cli_message (
@@ -941,7 +937,7 @@ def select_batch_kwargs_generator(
941
937
generator_names = list (available_data_asset_names_by_generator .keys ())
942
938
choices = "\n " .join (
943
939
[
944
- " {}. {}" . format ( i , generator_name )
940
+ f " { i } . { generator_name } "
945
941
for i , generator_name in enumerate (generator_names , 1 )
946
942
]
947
943
)
@@ -1107,14 +1103,13 @@ def _get_batch_kwargs_from_generator_or_from_file_path(
1107
1103
generator .get_available_data_asset_names ()["names" ], key = lambda x : x [0 ]
1108
1104
)
1109
1105
available_data_asset_names_str = [
1110
- "{} ({})" .format (name [0 ], name [1 ])
1111
- for name in available_data_asset_names
1106
+ f"{ name [0 ]} ({ name [1 ]} )" for name in available_data_asset_names
1112
1107
]
1113
1108
1114
1109
data_asset_names_to_display = available_data_asset_names_str [:50 ]
1115
1110
choices = "\n " .join (
1116
1111
[
1117
- " {}. {}" . format ( i , name )
1112
+ f " { i } . { name } "
1118
1113
for i , name in enumerate (data_asset_names_to_display , 1 )
1119
1114
]
1120
1115
)
@@ -1294,14 +1289,13 @@ def _get_batch_kwargs_for_sqlalchemy_datasource(
1294
1289
temp_generator .get_available_data_asset_names ()["names" ]
1295
1290
)
1296
1291
available_data_asset_names_str = [
1297
- "{} ({})" .format (name [0 ], name [1 ])
1298
- for name in available_data_asset_names
1292
+ f"{ name [0 ]} ({ name [1 ]} )" for name in available_data_asset_names
1299
1293
]
1300
1294
1301
1295
data_asset_names_to_display = available_data_asset_names_str
1302
1296
choices = "\n " .join (
1303
1297
[
1304
- " {}. {}" . format ( i , name )
1298
+ f " { i } . { name } "
1305
1299
for i , name in enumerate (data_asset_names_to_display , 1 )
1306
1300
]
1307
1301
)
@@ -1628,9 +1622,7 @@ def profile_datasource(
1628
1622
Which database backend are you using?
1629
1623
{}
1630
1624
""" .format (
1631
- "\n " .join (
1632
- [" {}. {}" .format (i , db .value ) for i , db in enumerate (SupportedDatabases , 1 )]
1633
- )
1625
+ "\n " .join ([f" { i } . { db .value } " for i , db in enumerate (SupportedDatabases , 1 )])
1634
1626
)
1635
1627
1636
1628
msg_prompt_filesys_enter_base_path = """
0 commit comments