Skip to content
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

Allow multi-index column names for inferring return type schema with names. #2117

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

ueshin
Copy link
Collaborator

@ueshin ueshin commented Mar 23, 2021

Allow multi-index column names for inferring return type schema with names.

  • Before
>>> pdf = pd.DataFrame({("x", "a"): [1, 2, 3], ("y", "b"): [3, 4, 5]})
>>> def func() -> ks.DataFrame[zip(pdf.columns, pdf.dtypes)]:
...     pass
>>> infer_return_type(func).tpe
Traceback (most recent call last):
...
TypeError: not all arguments converted during string formatting
  • After
>>> pdf = pd.DataFrame({("x", "a"): [1, 2, 3], ("y", "b"): [3, 4, 5]})
>>> def func() -> ks.DataFrame[zip(pdf.columns, pdf.dtypes)]:
...     pass
>>> infer_return_type(func).tpe
StructType(List(StructField((x, a),LongType,true),StructField((y, b),LongType,true)))

@codecov-io
Copy link

codecov-io commented Mar 23, 2021

Codecov Report

Merging #2117 (db4c122) into master (deccf33) will decrease coverage by 0.72%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2117      +/-   ##
==========================================
- Coverage   95.36%   94.64%   -0.73%     
==========================================
  Files          60       60              
  Lines       13544    13545       +1     
==========================================
- Hits        12916    12819      -97     
- Misses        628      726      +98     
Impacted Files Coverage Δ
databricks/koalas/typedef/typehints.py 94.56% <100.00%> (+0.02%) ⬆️
databricks/koalas/usage_logging/__init__.py 27.27% <0.00%> (-65.29%) ⬇️
databricks/koalas/usage_logging/usage_logger.py 47.82% <0.00%> (-52.18%) ⬇️
databricks/conftest.py 93.75% <0.00%> (-6.25%) ⬇️
databricks/koalas/__init__.py 88.15% <0.00%> (-3.95%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deccf33...db4c122. Read the comment docs.

Copy link
Contributor

@itholic itholic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ueshin
Copy link
Collaborator Author

ueshin commented Mar 24, 2021

Thanks! merging.

@ueshin ueshin merged commit f4408e3 into databricks:master Mar 24, 2021
@ueshin ueshin deleted the infer_multiindex_columns branch March 24, 2021 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants