Skip to content

Conversation

@jimexist
Copy link
Member

@jimexist jimexist commented Jun 2, 2021

Which issue does this PR close?

Closes #479
Depends on #483

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@jorgecarleitao
Copy link
Member

Thanks a lot, @jimexist . This makes sense, however, I have a question, though:

pyo3 uses rusts' docs (///) to populate Python's documentation. Maybe there is a way to do it via a macro, but atm this increases the barrier to add doc strings to the functions, no? I.e. how do we add a docstring to say ascii in this new code base?

@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2021

Codecov Report

Merging #477 (03432e5) into master (e713bc3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #477   +/-   ##
=======================================
  Coverage   75.95%   75.95%           
=======================================
  Files         154      154           
  Lines       26349    26349           
=======================================
  Hits        20014    20014           
  Misses       6335     6335           

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 e713bc3...03432e5. Read the comment docs.

@jimexist
Copy link
Member Author

jimexist commented Jun 2, 2021

Thanks a lot, @jimexist . This makes sense, however, I have a question, though:

pyo3 uses rusts' docs (///) to populate Python's documentation. Maybe there is a way to do it via a macro, but atm this increases the barrier to add doc strings to the functions, no? I.e. how do we add a docstring to say ascii in this new code base?

maybe this will work?

@jimexist
Copy link
Member Author

jimexist commented Jun 2, 2021

In [3]: from datafusion import functions as f

In [4]: dir(f)
Out[4]:
['__all__',
 '__doc__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 'array',
 'ascii',
 'avg',
 'bit_length',
 'btrim',
 'character_length',
 'chr',
 'col',
 'concat_ws',
 'count',
 'in_list',
 'initcap',
 'left',
 'lit',
 'lower',
 'lpad',
 'ltrim',
 'max',
 'md5',
 'min',
 'now',
 'octet_length',
 'random',
 'regexp_replace',
 'repeat',
 'replace',
 'reverse',
 'right',
 'rpad',
 'rtrim',
 'sha224',
 'sha256',
 'sha384',
 'sha512',
 'split_part',
 'starts_with',
 'strpos',
 'substr',
 'sum',
 'to_hex',
 'translate',
 'trim',
 'udaf',
 'udf',
 'upper']

In [5]: f.ascii??
Docstring: Returns the numeric code of the first character of the argument. In UTF8 encoding, returns the Unicode code point of the character. In other multibyte encodings, the argument must be an ASCII character.
Type:      builtin_function_or_method

@jimexist jimexist changed the title Simplify python function def python: simplify python function def Jun 2, 2021
@jimexist
Copy link
Member Author

jimexist commented Jun 2, 2021

error is likely not relevant, merge after fix in #468

@alamb alamb added the python label Jun 2, 2021
@jimexist jimexist changed the title python: simplify python function def simplify python function definitions Jun 3, 2021
@jimexist jimexist force-pushed the simplify-python-function-def branch 2 times, most recently from 11e788f to 74b25a4 Compare June 3, 2021 04:16
@jimexist jimexist force-pushed the simplify-python-function-def branch from 74b25a4 to 03432e5 Compare June 3, 2021 23:38
@jorgecarleitao jorgecarleitao merged commit 53792ec into apache:master Jun 4, 2021
@jimexist jimexist deleted the simplify-python-function-def branch June 4, 2021 03:53
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.

reduce boilerplate in defining and exposing functions in Python

4 participants