Skip to content

Commit

Permalink
[lint] fix flake8 issues
Browse files Browse the repository at this point in the history
- fix too small variable names
- remove useless f-strings
  • Loading branch information
Adrien Di Mascio authored and adimascio committed May 25, 2020
1 parent 63e674b commit a62d3a1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

def get_static_file_paths():
pkg = HERE / 'toucan_connectors'
paths = pkg.glob(f'**/*')
paths = pkg.glob('**/*')
paths = [str(path.relative_to(pkg)) for path in paths]
return paths

Expand Down
4 changes: 2 additions & 2 deletions tests/oracle_sql/test_oracle_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def test_oracle_get_df(mocker):
reasq = mocker.patch('pandas.read_sql')

oracle_connector = OracleSQLConnector(
name='my_oracle_sql_con', user='system', password='oracle', dsn=f'localhost:22/xe'
name='my_oracle_sql_con', user='system', password='oracle', dsn='localhost:22/xe'
)
datasource = OracleSQLDataSource(
domain='Oracle test', name='my_oracle_sql_con', query='SELECT * FROM City;'
)
oracle_connector.get_df(datasource)

snock.assert_called_once_with(user='system', password='oracle', dsn=f'localhost:22/xe')
snock.assert_called_once_with(user='system', password='oracle', dsn='localhost:22/xe')

reasq.assert_called_once_with('SELECT * FROM City', con=snock())

Expand Down
2 changes: 1 addition & 1 deletion toucan_connectors/aircall/aircall_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .constants import MAX_RUNS, PER_PAGE
from .helpers import DICTIONARY_OF_FORMATTERS, build_df, build_empty_df

BASE_ROUTE = f'https://proxy.bearer.sh/aircall_oauth'
BASE_ROUTE = 'https://proxy.bearer.sh/aircall_oauth'
BEARER_API_KEY = os.environ.get('BEARER_API_KEY')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _retrieve_data(self, data_source: GoogleMyBusinessDataSource) -> pd.DataFram
else:
# retrieve all locations:
locations = service.accounts().locations().list(parent=name).execute()
location_names = [l['name'] for l in locations['locations']]
location_names = [loc['name'] for loc in locations['locations']]

query = {
'locationNames': location_names,
Expand Down
4 changes: 2 additions & 2 deletions toucan_connectors/micro_strategy/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def visit_dict(d: dict):
d.update(**fill_constant(d.pop('constant'), d.get('dataType')))

@visit.register(list)
def visit_list(l: list):
for e in l:
def visit_list(node: list):
for e in node:
visit(e)

vf = deepcopy(vf)
Expand Down
2 changes: 1 addition & 1 deletion toucan_connectors/snowflake/snowflake_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __get_validators__(cls):
@classmethod
def validate(cls, v):
if not path.exists(v):
raise ValueError(f'path does not exists: v')
raise ValueError(f'path does not exists: {v}')
return v


Expand Down

0 comments on commit a62d3a1

Please sign in to comment.