-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style(mypy): Enforcing typing for some modules #9416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,15 @@ | |
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from sqlalchemy import Metadata | ||
from sqlalchemy.engine import Engine | ||
from sqlalchemy.exc import IntegrityError | ||
from sqlalchemy.sql import and_, func, functions, join, literal, select | ||
|
||
from superset.models.tags import ObjectTypes, TagTypes | ||
|
||
|
||
def add_types(engine, metadata): | ||
def add_types(engine: Engine, metadata: Metadata) -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dpgaspar could you verify if the |
||
""" | ||
Tag every object according to its type: | ||
|
||
|
@@ -163,7 +164,7 @@ def add_types(engine, metadata): | |
engine.execute(query) | ||
|
||
|
||
def add_owners(engine, metadata): | ||
def add_owners(engine: Engine, metadata: Metadata) -> None: | ||
""" | ||
Tag every object according to its owner: | ||
|
||
|
@@ -319,7 +320,7 @@ def add_owners(engine, metadata): | |
engine.execute(query) | ||
|
||
|
||
def add_favorites(engine, metadata): | ||
def add_favorites(engine: Engine, metadata: Metadata) -> None: | ||
""" | ||
Tag every object that was favorited: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ def update(cls, model: Model, properties: Dict, commit: bool = True) -> Model: | |
return model | ||
|
||
@classmethod | ||
def delete(cls, model: Model, commit=True): | ||
def delete(cls, model: Model, commit: bool = True) -> Model: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I raised this in #9418 , I think that PR will benefit from this change. |
||
""" | ||
Generic delete a model | ||
:raises: DAOCreateFailedError | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed like a bug, i.e.,
__repr__
should return astr
.