-
Notifications
You must be signed in to change notification settings - Fork 167
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
Adding Python 3.10 to test matrix #177
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6be80ad
Updating to test python 3.10
leahwicz a6d52d3
Fixing mypy issues from upgrade
leahwicz a4396b4
Extending path in init
leahwicz bd57ad8
Adding newline
leahwicz 10b1c57
Updating changelog
leahwicz 7ae1e66
Adding response stubs
leahwicz 3a1d161
Merge branch 'main' into leahwicz/py310
leahwicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from pkgutil import extend_path | ||
|
||
__path__ = extend_path(__path__, __name__) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[mypy] | ||
mypy_path = ./third-party-stubs | ||
mypy_path = third-party-stubs/ | ||
namespace_packages = True | ||
exclude = third-party-stubs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
from collections.abc import Sequence | ||
|
||
from typing import Any, Optional, Callable, Iterable, Dict, Union | ||
|
||
from . import data_types as data_types | ||
from .data_types import ( | ||
Text as Text, | ||
Number as Number, | ||
Boolean as Boolean, | ||
DateTime as DateTime, | ||
Date as Date, | ||
TimeDelta as TimeDelta, | ||
) | ||
|
||
class MappedSequence(Sequence): | ||
def __init__(self, values: Any, keys: Optional[Any] = ...) -> None: ... | ||
def __unicode__(self): ... | ||
def __getitem__(self, key: Any): ... | ||
def __setitem__(self, key: Any, value: Any) -> None: ... | ||
def __iter__(self): ... | ||
def __len__(self): ... | ||
def __eq__(self, other: Any): ... | ||
def __ne__(self, other: Any): ... | ||
def __contains__(self, value: Any): ... | ||
def keys(self): ... | ||
def values(self): ... | ||
def items(self): ... | ||
def get(self, key: Any, default: Optional[Any] = ...): ... | ||
def dict(self): ... | ||
|
||
class Row(MappedSequence): ... | ||
|
||
class Table: | ||
def __init__( | ||
self, | ||
rows: Any, | ||
column_names: Optional[Any] = ..., | ||
column_types: Optional[Any] = ..., | ||
row_names: Optional[Any] = ..., | ||
_is_fork: bool = ..., | ||
) -> None: ... | ||
def __len__(self): ... | ||
def __iter__(self): ... | ||
def __getitem__(self, key: Any): ... | ||
@property | ||
def column_types(self): ... | ||
@property | ||
def column_names(self): ... | ||
@property | ||
def row_names(self): ... | ||
@property | ||
def columns(self): ... | ||
@property | ||
def rows(self): ... | ||
def print_csv(self, **kwargs: Any) -> None: ... | ||
def print_json(self, **kwargs: Any) -> None: ... | ||
def where(self, test: Callable[[Row], bool]) -> "Table": ... | ||
def select(self, key: Union[Iterable[str], str]) -> "Table": ... | ||
# these definitions are much narrower than what's actually accepted | ||
@classmethod | ||
def from_object( | ||
cls, obj: Iterable[Dict[str, Any]], *, column_types: Optional["TypeTester"] = None | ||
) -> "Table": ... | ||
@classmethod | ||
def from_csv( | ||
cls, path: Iterable[str], *, column_types: Optional["TypeTester"] = None | ||
) -> "Table": ... | ||
@classmethod | ||
def merge(cls, tables: Iterable["Table"]) -> "Table": ... | ||
def rename( | ||
self, | ||
column_names: Optional[Iterable[str]] = None, | ||
row_names: Optional[Any] = None, | ||
slug_columns: bool = False, | ||
slug_rows: bool = False, | ||
**kwargs: Any, | ||
) -> "Table": ... | ||
|
||
class TypeTester: | ||
def __init__( | ||
self, force: Any = ..., limit: Optional[Any] = ..., types: Optional[Any] = ... | ||
) -> None: ... | ||
def run(self, rows: Any, column_names: Any): ... | ||
|
||
class MaxPrecision: | ||
def __init__(self, column_name: Any) -> None: ... | ||
|
||
# this is not strictly true, but it's all we care about. | ||
def aggregate(self, aggregations: MaxPrecision) -> int: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
from typing import Any, Optional | ||
|
||
DEFAULT_NULL_VALUES: Any | ||
|
||
class DataType: | ||
null_values: Any = ... | ||
def __init__(self, null_values: Any = ...) -> None: ... | ||
def test(self, d: Any): ... | ||
def cast(self, d: Any) -> None: ... | ||
def csvify(self, d: Any): ... | ||
def jsonify(self, d: Any): ... | ||
|
||
DEFAULT_TRUE_VALUES: Any | ||
DEFAULT_FALSE_VALUES: Any | ||
|
||
class Boolean(DataType): | ||
true_values: Any = ... | ||
false_values: Any = ... | ||
def __init__( | ||
self, true_values: Any = ..., false_values: Any = ..., null_values: Any = ... | ||
) -> None: ... | ||
def cast(self, d: Any): ... | ||
def jsonify(self, d: Any): ... | ||
|
||
ZERO_DT: Any | ||
|
||
class Date(DataType): | ||
date_format: Any = ... | ||
parser: Any = ... | ||
def __init__(self, date_format: Optional[Any] = ..., **kwargs: Any) -> None: ... | ||
def cast(self, d: Any): ... | ||
def csvify(self, d: Any): ... | ||
def jsonify(self, d: Any): ... | ||
|
||
class DateTime(DataType): | ||
datetime_format: Any = ... | ||
timezone: Any = ... | ||
def __init__( | ||
self, datetime_format: Optional[Any] = ..., timezone: Optional[Any] = ..., **kwargs: Any | ||
) -> None: ... | ||
def cast(self, d: Any): ... | ||
def csvify(self, d: Any): ... | ||
def jsonify(self, d: Any): ... | ||
|
||
DEFAULT_CURRENCY_SYMBOLS: Any | ||
POSITIVE: Any | ||
NEGATIVE: Any | ||
|
||
class Number(DataType): | ||
locale: Any = ... | ||
currency_symbols: Any = ... | ||
group_symbol: Any = ... | ||
decimal_symbol: Any = ... | ||
def __init__( | ||
self, | ||
locale: str = ..., | ||
group_symbol: Optional[Any] = ..., | ||
decimal_symbol: Optional[Any] = ..., | ||
currency_symbols: Any = ..., | ||
**kwargs: Any, | ||
) -> None: ... | ||
def cast(self, d: Any): ... | ||
def jsonify(self, d: Any): ... | ||
|
||
class TimeDelta(DataType): | ||
def cast(self, d: Any): ... | ||
|
||
class Text(DataType): | ||
cast_nulls: Any = ... | ||
def __init__(self, cast_nulls: bool = ..., **kwargs: Any) -> None: ... | ||
def cast(self, d: Any): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: I've read changing path this way is uncommon. What's the reason here? Super curious about the use case. edit: Does it have to do with Gerda's comment by chance?
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.
We had a convo in Slack here about it but the TLDR is that we reuse
dbt
namespace twice which confuses mypy. This helps just combine them for mypy to reference. In the long run, we should refactor the codebase to not have this issue