Git Product home page Git Product logo

greenplumpython's People

Contributors

ahmedrachid avatar beeender avatar dependabot[bot] avatar gp-releng avatar haozhouwang avatar higuoxing avatar liuxueyang avatar rmtt avatar ruxuez avatar violet2016 avatar wengyanqing avatar xuebinsu avatar yihong0618 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greenplumpython's Issues

gpApply() fails to find source code when function is defined in python shell

i am using the python3 shell to try out a greenplumpython that i built myself. python version 3.6.8.

$ python3
>>> import pandas as pd
>>> import greenplumpython as gppy
>>> connection = gppy.GPConnection()
>>> conn = connection.connect( 'localhost', 6000, 'testdb', 'gpadmin', '')
>>> testdb_inst = gppy.GPDatabase(conn)
>>> dfwrap_table1 = testdb_inst.get_table( 'table1', 'public')
>>> otbl_cols = list()
>>> otuple = ('c1', 'int')
>>> otbl_cols.append(otuple)
>>> otbl_meta = gppy.GPTableMetadata(None, otbl_cols, None)
>>> # apply function
... def input_py_func(row_element, extra_args):
...     return row_element + extra_args
... 
>>> df = gppy.gpApply(dfwrap_table1, input_py_func, testdb_inst, otbl_meta, 'plc_python_shared')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gpadmin/GreenplumPython/greenplumpython/core/gpapply.py", line 39, in gpApply
    s = inspect.getsource(py_func)
  File "/usr/lib64/python3.6/inspect.py", line 973, in getsource
    lines, lnum = getsourcelines(object)
  File "/usr/lib64/python3.6/inspect.py", line 955, in getsourcelines
    lines, lnum = findsource(object)
  File "/usr/lib64/python3.6/inspect.py", line 786, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

this may be related: https://stackoverflow.com/questions/57035364/inspect-getsourcelinesobject-shows-oserror-if-run-from-python-shell-but-gives

should gpApply() work when the function is defined inline in the shell work? or do i need to define the function in a script?

Session connection changes for a same db object

When running multiple notebooks at the same time using GreenplumPython, the backend pid of the session has changed while the db object id remains the same. I add that there is no session disconnection happend between the changes.

Session of the starting current notebook:

BACKEND SESSION PID:  [RealDictRow([('pg_backend_pid', 11777)])]
DB OBJECT ID:  140420733129040
CREATE FUNCTION "pg_temp"."func_f8e86dfce7934fb98e098e9cc0eb75d6" (date "text") RETURNS "text" AS $$

After running several cells, the session pid has changed, which refers to another notebook's session:

BACKEND SESSION PID:  [RealDictRow([('pg_backend_pid', 11780)])]
DB OBJECT ID:  140420733129040
function pg_temp.func_f8e86dfce7934fb98e098e9cc0eb75d6(text) does not exist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.