Skip to content

Commit ac17eb2

Browse files
committed
More lint fixes
1 parent 61abe0b commit ac17eb2

File tree

9 files changed

+7
-13
lines changed

9 files changed

+7
-13
lines changed

azure-kusto-data/azure/kusto/data/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def parse_datetime(frame, col):
129129
# if frame contains ".", replace "Z" with ".000Z"
130130
# == False is not a mistake - that's the pandas way to do it
131131
contains_dot = frame[col].str.contains(".")
132-
frame.loc[contains_dot == False, col] = frame.loc[contains_dot == False, col].str.replace("Z", ".000Z")
132+
frame.loc[not contains_dot, col] = frame.loc[not contains_dot, col].str.replace("Z", ".000Z")
133133
frame[col] = pd.to_datetime(frame[col], errors="coerce", **args)
134134
return frame[col]
135135

azure-kusto-data/tests/aio/test_async_token_providers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def get_token_value(self, token: dict):
6767
assert token is not None
6868
assert TokenConstants.MSAL_ERROR not in token
6969

70-
value = None
7170
if TokenConstants.MSAL_ACCESS_TOKEN in token:
7271
return token[TokenConstants.MSAL_ACCESS_TOKEN]
7372
elif TokenConstants.AZ_ACCESS_TOKEN in token:

azure-kusto-data/tests/aio/test_kusto_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async def test_raise_network(self):
8080
self._mock_query(aioresponses_mock)
8181
async with KustoClient(self.HOST) as client:
8282
with pytest.raises(KustoNetworkError):
83-
response = await client.execute_query("PythonTest", "raiseNetwork")
83+
await client.execute_query("PythonTest", "raiseNetwork")
8484

8585
@aio_documented_by(KustoClientTestsSync.test_sanity_control_command)
8686
@pytest.mark.asyncio

azure-kusto-data/tests/test_client_request_properties.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def test_custom_crp_tracing_properties_override_kcsb():
127127
def test_set_connector_name_and_version():
128128
kcsb = KustoConnectionStringBuilder("test")
129129
kcsb._set_connector_details("myConnector", "myVersion", send_user=False)
130-
crp = ClientRequestProperties()
131130

132131
params = ExecuteRequestParams._from_query(
133132
"somequery",
@@ -150,7 +149,6 @@ def test_set_connector_name_and_version():
150149
def test_set_connector_no_app_version():
151150
kcsb = KustoConnectionStringBuilder("test")
152151
kcsb._set_connector_details("myConnector", "myVersion", app_name="myApp", send_user=True)
153-
crp = ClientRequestProperties()
154152

155153
params = ExecuteRequestParams._from_query(
156154
"somequery",

azure-kusto-data/tests/test_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_dataframe_from_result_table():
4949
for k, v in {"year": 2021, "month": 12, "day": 22, "hour": 11, "minute": 43, "second": 00}.items():
5050
assert getattr(df.iloc[0].RecordTime, k) == v
5151
assert type(df.iloc[0].RecordBool) is numpy.bool_
52-
assert df.iloc[0].RecordBool == True
52+
assert df.iloc[0].RecordBool
5353
assert type(df.iloc[0].RecordInt) is numpy.int32
5454
assert df.iloc[0].RecordInt == 5678
5555
assert type(df.iloc[0].RecordInt64) is numpy.int64

azure-kusto-data/tests/test_kusto_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_raise_network(self, mock_post, method):
4242
"""Test query V2."""
4343
with KustoClient(self.HOST) as client:
4444
with pytest.raises(KustoNetworkError):
45-
response = method.__call__(client, "PythonTest", "raiseNetwork")
45+
method.__call__(client, "PythonTest", "raiseNetwork")
4646

4747
@patch("requests.Session.post", side_effect=mocked_requests_post)
4848
def test_sanity_control_command(self, mock_post):
@@ -100,7 +100,7 @@ def test_partial_results(self, mock_post, method):
100100
with pytest.raises(KustoMultiApiError) as e:
101101
response = method.__call__(client, "PythonTest", query, properties=properties)
102102
if type(response) == KustoStreamingResponseDataSet:
103-
results = list(get_response_first_primary_result(response))
103+
list(get_response_first_primary_result(response))
104104
errors = e.value.get_api_errors()
105105
assert len(errors) == 1
106106
assert errors[0].code == "LimitsExceeded"

azure-kusto-data/tests/test_kusto_connection_string_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_add_msi(self):
270270

271271
exception_occurred = False
272272
try:
273-
fault = KustoConnectionStringBuilder.with_aad_managed_service_identity_authentication("localhost", client_id=client_guid, object_id=object_guid)
273+
KustoConnectionStringBuilder.with_aad_managed_service_identity_authentication("localhost", client_id=client_guid, object_id=object_guid)
274274
except ValueError:
275275
exception_occurred = True
276276
finally:

azure-kusto-data/tests/test_security.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ def test_msi_auth():
4242
Please be prudent in adding any future tests!
4343
"""
4444
client_guid = "kjhjk"
45-
object_guid = "87687687"
46-
res_guid = "kajsdghdijewhag"
4745

4846
"""
4947
Use of object_id and msi_res_id is disabled pending support of azure-identity

azure-kusto-data/tests/test_token_providers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def get_token_value(token: dict):
113113
assert token is not None
114114
assert TokenConstants.MSAL_ERROR not in token
115115

116-
value = None
117116
if TokenConstants.MSAL_ACCESS_TOKEN in token:
118117
return token[TokenConstants.MSAL_ACCESS_TOKEN]
119118
elif TokenConstants.AZ_ACCESS_TOKEN in token:
@@ -287,7 +286,7 @@ def test_app_key_provider_when_url_not_valid():
287286
if app_auth:
288287
with pytest.raises(KustoNetworkError):
289288
with ApplicationKeyTokenProvider("NoURI", app_auth.auth_id, app_auth.app_id, app_auth.app_key) as provider:
290-
token = provider.get_token()
289+
provider.get_token()
291290

292291
@staticmethod
293292
def test_app_cert_provider():

0 commit comments

Comments
 (0)