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

Cannot define UDTFs from command prompt #476

Open
pearu opened this issue Mar 30, 2022 · 0 comments
Open

Cannot define UDTFs from command prompt #476

pearu opened this issue Mar 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@pearu
Copy link
Contributor

pearu commented Mar 30, 2022

Example:

>>> @omnisci('int32(TableFunctionManager, Column<T>, T, OutputColumn<T>)', T=['int32', 'int64', 'float32', 'float64'])
... def colincr(mgr, input, di, output):
...     mgr.set_output_row_size(input.size())
...     for i in range(input.size()):
...         output[i] = input[i] + di
...     return output.size()
... 
>>> omnisci.register()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/site-packages/rbc/omniscidb.py", line 1172, in register
    return self._register()
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/site-packages/rbc/omniscidb.py", line 1228, in _register
    udtfs_map[fid] = self._make_udtf(caller, orig_sig, sig)
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/site-packages/rbc/omniscidb.py", line 1100, in _make_udtf
    sizer_index = get_literal_return(caller.func, verbose=self.debug)
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/site-packages/rbc/omniscidb.py", line 69, in get_literal_return
    for line in inspect.getsourcelines(func)[0]:
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/inspect.py", line 1129, in getsourcelines
    lines, lnum = findsource(object)
  File "/home/pearu/mc3/envs/omnisci-user/lib/python3.10/inspect.py", line 958, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

In the given case, sizer_index is irrelevant, hence the example should be succesful.

@pearu pearu added the bug Something isn't working label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant