madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <>
Subject [GitHub] incubator-madlib pull request #119: Multiple: Minor changes for GPDB5 and HA...
Date Thu, 20 Apr 2017 19:04:19 GMT
Github user iyerr3 commented on a diff in the pull request:
    --- Diff: src/ports/postgres/modules/graph/sssp.py_in ---
    @@ -314,9 +314,13 @@ def graph_sssp(schema_madlib, vertex_table, vertex_id, edge_table,
     					SELECT {grp_comma} id, {weight}, parent FROM {oldupdate};
    -				DROP TABLE {out_table};
    -				ALTER TABLE {temp_table} RENAME TO {out_table};
    -				CREATE TABLE {temp_table} AS (
    +				"""
    +				plpy.execute(sql.format(**locals()))
    +				sql = "DROP TABLE {out_table}"
    +				plpy.execute(sql.format(**locals()))
    --- End diff --
    The above two lines can easily be merged to single statement (same for the ones below).

    Also avoid using locals() if there are only few variables in the format list. Explicitly
adding the variables makes it easy to see their usage.  

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message