Thread: PATCH: To fix the issue in constraints node (pgAdmin4)
Hi,
PFA patch to fix the issue in exclusion constrains where it was throwing error when user clicks on dependencies tab.
RM#1892
I have found & also fixed the same issue in Index constrains in this patch.
--
Regards,
Attachment
Hi On Fri, Oct 28, 2016 at 1:15 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: > Hi, > > PFA patch to fix the issue in exclusion constrains where it was throwing > error when user clicks on dependencies tab. > RM#1892 > > I have found & also fixed the same issue in Index constrains in this patch. I'm getting weird results with this patch. When I first applied it, it displayed the dependents and dependencies on the test exclusion constraint, but without an icon on the entry on the Depends panel. I see no entries for a primary key constraint though, and after selecting one, if I reselect the exclusion constraint, I then no longer see the dependencies/dependents listed. If I try to refresh the node, I get the following exception: File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 2000, in __call__ return self.wsgi_app(environ, start_response) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1991, in wsgi_app try: try: response = self.full_dispatch_request() except Exception as e: error = e response = self.make_response(self.handle_exception(e)) return response(environ, start_response) finally: if self.should_ignore_error(error): error = None ctx.auto_pop(error) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1567, in handle_exception reraise(exc_type, exc_value, tb) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app response = self.full_dispatch_request() File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request rv = self.handle_user_exception(e) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception reraise(exc_type, exc_value, tb) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request rv = self.dispatch_request() File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 235, in dispatch_request return method(*args, **kwargs) File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py", line 248, in wrap return f(*args, **kwargs) File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py", line 415, in node if len(rset['rows']) == 0: TypeError: string indices must be integers Thanks. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Hi,
I have fixed the refresh on exclusion_constraint node issue but for displaying icon in grid I need to check with Akshay because the appendGridToPanel model( in depends.js) is set node type as 'exclude' instead of 'exclusion_constraint', I am not able to find root cause of this behaviour.
I will send separate patch for displaying icon in grid meanwhile please review updated patch.
--
Regards,
On Fri, Oct 28, 2016 at 9:04 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi
On Fri, Oct 28, 2016 at 1:15 PM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi,
>
> PFA patch to fix the issue in exclusion constrains where it was throwing
> error when user clicks on dependencies tab.
> RM#1892
>
> I have found & also fixed the same issue in Index constrains in this patch.
I'm getting weird results with this patch. When I first applied it, it
displayed the dependents and dependencies on the test exclusion
constraint, but without an icon on the entry on the Depends panel. I
see no entries for a primary key constraint though, and after
selecting one, if I reselect the exclusion constraint, I then no
longer see the dependencies/dependents listed. If I try to refresh the
node, I get the following exception:
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1991, in wsgi_app
try:
try:
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.make_response(self.handle_exception(e))
return response(environ, start_response)
finally:
if self.should_ignore_error(error):
error = None
ctx.auto_pop(error)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/app.py",
line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/flask/views.py",
line 84, in view
return self.dispatch_request(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
235, in dispatch_request
return method(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_ groups/servers/databases/ schemas/tables/constraints/ exclusion_constraint/__init__. py",
line 248, in wrap
return f(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_ groups/servers/databases/ schemas/tables/constraints/ exclusion_constraint/__init__. py",
line 415, in node
if len(rset['rows']) == 0:
TypeError: string indices must be integers
Thanks.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Thanks, committed, and ticket updated to 70% complete.
On Monday, October 31, 2016, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Monday, October 31, 2016, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,I have fixed the refresh on exclusion_constraint node issue but for displaying icon in grid I need to check with Akshay because the appendGridToPanel model( in depends.js) is set node type as 'exclude' instead of 'exclusion_constraint', I am not able to find root cause of this behaviour.I will send separate patch for displaying icon in grid meanwhile please review updated patch.--Regards,On Fri, Oct 28, 2016 at 9:04 PM, Dave Page <dpage@pgadmin.org> wrote:Hi
On Fri, Oct 28, 2016 at 1:15 PM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi,
>
> PFA patch to fix the issue in exclusion constrains where it was throwing
> error when user clicks on dependencies tab.
> RM#1892
>
> I have found & also fixed the same issue in Index constrains in this patch.
I'm getting weird results with this patch. When I first applied it, it
displayed the dependents and dependencies on the test exclusion
constraint, but without an icon on the entry on the Depends panel. I
see no entries for a primary key constraint though, and after
selecting one, if I reselect the exclusion constraint, I then no
longer see the dependencies/dependents listed. If I try to refresh the
node, I get the following exception:
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1991, in wsgi_app
try:
try:
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.make_response(self.handle_exception(e))
return response(environ, start_response)
finally:
if self.should_ignore_error(error):
error = None
ctx.auto_pop(error)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/app.py",
line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/flask/views.py",
line 84, in view
return self.dispatch_request(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
235, in dispatch_request
return method(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups /servers/databases/schemas/ tables/constraints/exclusion_ constraint/__init__.py",
line 248, in wrap
return f(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups /servers/databases/schemas/ tables/constraints/exclusion_ constraint/__init__.py",
line 415, in node
if len(rset['rows']) == 0:
TypeError: string indices must be integers
Thanks.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company