Skip to content

Commit 94532cb

Browse files
committed
PEP8 cleanup
1 parent 633e245 commit 94532cb

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

dbt/adapters/sqlite/connections.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
import glob
55
import os.path
66
import sqlite3
7-
from typing import List, Optional, Tuple, Any, Iterable, Dict
7+
from typing import Optional, Tuple, Any
88

99

1010
from dbt.adapters.base import Credentials
1111
from dbt.adapters.sql import SQLConnectionManager
12-
from dbt.contracts.connection import Connection, ConnectionState
12+
from dbt.contracts.connection import Connection
1313
from dbt.exceptions import (
1414
DatabaseException,
1515
FailedToConnectException,
16-
InternalException,
17-
RuntimeException,
18-
warn_or_error,
16+
RuntimeException
1917
)
2018
from dbt.logger import GLOBAL_LOGGER as logger
2119

dbt/adapters/sqlite/impl.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
import decimal
3-
import re
43
from typing import List, Optional, Set
54

65
import agate
@@ -47,21 +46,24 @@ def rename_relation(self, from_relation, to_relation):
4746
elif existing_relation_type == 'view':
4847

4948
result = self.connections.execute(f"""
50-
SELECT sql FROM {from_relation.schema}.sqlite_master WHERE type = 'view' and name = '{from_relation.identifier}'
49+
SELECT sql FROM {from_relation.schema}.sqlite_master
50+
WHERE type = 'view' and name = '{from_relation.identifier}'
5151
""", fetch=True)
5252

5353
definition = result[1].rows[0][0]
5454

55-
self.connections.execute(f"DROP VIEW {from_relation}");
55+
self.connections.execute(f"DROP VIEW {from_relation}")
5656

57-
self.connections.execute(f"DROP VIEW IF EXISTS {to_relation}");
57+
self.connections.execute(f"DROP VIEW IF EXISTS {to_relation}")
5858

5959
new_definition = definition.replace(from_relation.identifier, f"{to_relation}", 1)
6060

6161
self.connections.execute(new_definition)
6262

6363
else:
64-
raise NotImplementedException(f"I don't know how to rename this type of relation: {from_relation.type}, from: {from_relation}, to: {to_relation}")
64+
raise NotImplementedException(
65+
f"I don't know how to rename this type of relation: {from_relation.type}," +
66+
f" from: {from_relation}, to: {to_relation}")
6567

6668
def list_schemas(self, database: str) -> List[str]:
6769
"""
@@ -143,7 +145,7 @@ def _get_one_catalog(
143145

144146
for relation_row in results[1]:
145147
name = relation_row['name']
146-
relation_type= relation_row['data_type']
148+
relation_type = relation_row['data_type']
147149

148150
table_info = self.connections.execute(
149151
f"pragma {schema}.table_info({name})", fetch=True)

dbt/adapters/sqlite/relation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from dataclasses import dataclass
22

33
from dbt.adapters.base.relation import BaseRelation, Policy
4-
from dbt.exceptions import RuntimeException
54

65

76
@dataclass
@@ -22,4 +21,3 @@ class SQLiteIncludePolicy(Policy):
2221
class SQLiteRelation(BaseRelation):
2322
quote_policy: SQLiteQuotePolicy = SQLiteQuotePolicy()
2423
include_policy: SQLiteIncludePolicy = SQLiteIncludePolicy()
25-

0 commit comments

Comments
 (0)