please help us test trunk web2py

372 views
Skip to first unread message

Massimo Di Pierro

unread,
Feb 24, 2018, 9:44:19 PM2/24/18
to web2py-users
Please help us test the version of web2py which is posted on github.

I would like to release a new stable version and I would like to know if any of the changes has broken backward compatibility.
Also the icons are back in the latest welcome but use font-awesome.

Please check it. Thanks.

Massimo

Richard Vézina

unread,
Feb 26, 2018, 3:11:50 PM2/26/18
to web2py-users
I test a bit with the tester source from web2py.com download page... Work great with my old app, not test the welcome.

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Vézina

unread,
Feb 26, 2018, 5:53:30 PM2/26/18
to web2py-users
All my automated tests passed, but one which trigger a <class 'psycopg2.ProgrammingError'>(table name "TABLE NAME" specified more than once ) error...

This occurs only with the trunk not 2.14.6...

I will test it with the last stable to get more insigth about the issue...

Richard

Richard Vézina

unread,
Feb 26, 2018, 6:12:05 PM2/26/18
to web2py-users
Seems there in 2.16.1, but I am not sure if I have the same version or not...

I think I didn't test the trunk but 2.16.1 :(

Richard

Richard Vézina

unread,
Feb 26, 2018, 6:22:01 PM2/26/18
to web2py-users
Issue is present in both 2.16.1 and trunk...

Richard Vézina

unread,
Feb 26, 2018, 6:37:12 PM2/26/18
to web2py-users
Error come from my code... For some reason the previous version didn't trigger the issue... Maybe the DAL was filtering it or pass it to the backend or the postgres adapter wasn't complain...

Will investigate further as to why I have some peculiar condition in my code then how DAL is translating the web2py query in both version.

Stay tune...

Richard

pbreit

unread,
Feb 27, 2018, 1:29:54 AM2/27/18
to web2py-users
Could someone please confirm for me if I can just do a "git pull" or do I need to do something else to make sure I also get latest DAL?

Richard Vézina

unread,
Feb 27, 2018, 10:21:05 AM2/27/18
to web2py-users
git clone --recursive web2py repo http address

On Tue, Feb 27, 2018 at 1:29 AM, pbreit <pbreit...@gmail.com> wrote:
Could someone please confirm for me if I can just do a "git pull" or do I need to do something else to make sure I also get latest DAL?

--

Richard Vézina

unread,
Feb 27, 2018, 10:22:24 AM2/27/18
to web2py-users

Richard Vézina

unread,
Feb 27, 2018, 10:56:03 AM2/27/18
to web2py-users
I review my code and found what happen...

Somehow this query :

db()._select(db.table_name.other_table_id, join=db.table_name.on(db.table_name.other_table_id == db.other_table_name.id))

Return (2.14.6) :

SELECT table_name.other_table_id FROM other_table_name JOIN table_name ON (table_name.other_table_id = other_table_name.id);

Now it return (trunk-master and I guess 2.16.1) :

SELECT "table_name"."other_table_id" FROM "other_table_name" CROSS JOIN "table_name" JOIN "table_name" ON ("table_name"."other_table_id" = "other_table_name"."id");


I think there is a bug somewhere (pyDAL??), removing the CROSS JOIN table_name in red above resolve the issue...


Richard Vézina

unread,
Feb 27, 2018, 11:13:26 AM2/27/18
to web2py-users
Found that which seems related : 

And the initial post refered by villas : https://groups.google.com/d/msg/web2py/KpxWh4ikqG8/cDBbhiK_3F8J

There is not seems to have any issue being open for this over pyDAL repository

Richard

Leonel Câmara

unread,
Feb 27, 2018, 11:58:00 AM2/27/18
to web2py-users
I believe we deprecated empty queries as they caused way too many problems and bugs (e.g. common filters don't work).

Richard Vézina

unread,
Feb 27, 2018, 11:59:08 AM2/27/18
to web2py-users
CROSS JOIN get included when there is only one tablecolumn asked

db(db.auth_user.id == db.auth_membership.user_id).select(db.auth_user.username, db.auth_membership.group_id)
Out[1]: <Rows (834)>

In [2]: db(db.auth_user.id == db.auth_membership.user_id)._select(db.auth_user.username, db.auth_membership.group_id)
Out[2]: 'SELECT "auth_user"."username", "auth_membership"."group_id" FROM "auth_user", "auth_membership" WHERE ("auth_user"."id" = "auth_membership"."user_id");'

In [3]: db()._select(db.auth_user.username, db.auth_membership.group_id, join=db.auth_membership.on(db.auth_user.id == db.auth_membership.user_id))
Out[3]: 'SELECT "auth_user"."username", "auth_membership"."group_id" FROM "auth_user" JOIN "auth_membership" ON ("auth_user"."id" = "auth_membership"."user_id");'

In [4]: db()._select(db.auth_membership.group_id, join=db.auth_membership.on(db.auth_user.id == db.auth_membership.user_id))
Out[4]: 'SELECT "auth_membership"."group_id" FROM "auth_user" CROSS JOIN "auth_membership" JOIN "auth_membership" ON ("auth_user"."id" = "auth_membership"."user_id");'

Richard Vézina

unread,
Feb 27, 2018, 12:01:24 PM2/27/18
to web2py-users
In [6]: db(db.auth_user.id > 0)._select(db.auth_membership.group_id, join=db.auth_membership.on(db.auth_user.id == db.auth_membership.user_id))
Out[6]: 'SELECT "auth_membership"."group_id" FROM "auth_user" JOIN "auth_membership" ON ("auth_user"."id" = "auth_membership"."user_id") WHERE ("auth_user"."id" > 0);'

Seems to solve it...



On Tue, Feb 27, 2018 at 11:58 AM, Leonel Câmara <leonel...@gmail.com> wrote:
I believe we deprecated empty queries as they caused way too many problems and bugs (e.g. common filters don't work).

--

Richard Vézina

unread,
Feb 27, 2018, 12:39:52 PM2/27/18
to web2py-users
@Leonel, I recall about empty query beeing deprecated... But I can't find any reference to it neither in change log of pyDAL nor web2py change log... Niether the book...

Which version of the DAL the support been dropped?

Richard


Richard Vézina

unread,
Feb 27, 2018, 12:57:33 PM2/27/18
to web2py-users
Here : https://github.com/web2py/pydal/issues/388

I think the follow up update to the book and change log never occurs...

I am fine with patching my code and make sure I don't leave empty query... But I am curious to know if this "CROSS JOIN table_name" addition could be avoid otherwise than providing non empty query... I mean it rough mistake...

Richard 

Richard Vézina

unread,
Feb 27, 2018, 12:59:51 PM2/27/18
to web2py-users
At least there is a open issue on the book repo : https://github.com/web2py/web2py-book/issues/346

Richard Vézina

unread,
Feb 27, 2018, 2:12:08 PM2/27/18
to web2py-users
What causing the CROSS JOIN issue had been introduce between pyDAL 16.11 and 17.01


Richard

Richard Vézina

unread,
Feb 27, 2018, 4:30:18 PM2/27/18
to web2py-users
In 17.01 

line 627

if join and not left:
            cross_joins = iexcluded + list(itables_to_merge)

cross_joins contains both tables involve in the query, which wasn't the case in 16.11

I follow up and it could come from 

helpers.methods.merge_tablempas() (introduced in 17.01) use in _build_joins_for_select() or it could be caused by this piece of code included in the former mention function :

        tablemap = {}
        for item in param:
            if isinstance(item, Expression):
                item = item.first
            key = item._tablename
            if tablemap.get(key, item) is not item:
                raise ValueError('Name conflict in table list: %s' % key)
            tablemap[key] = item

At that point code get difficult to understand what it does...

Should we consider this a flaw in the actual code or  is this issue which goes away when not doing empty query is related to the difficulty we were having supporting the empty query syntax???

I guess the answer to this question will resolve this definitely...

Richard

Richard Vézina

unread,
Feb 27, 2018, 5:37:24 PM2/27/18
to web2py-users
Out of _build_joins_for_select() itables_to_merge variable has only one table which is the one implicated in the join (in this case "auth_user")... But another merge_tablemaps() occurs in red below :

        if join:
            (
                # FIXME? ijoin_tables is never used
                ijoin_tables, ijoin_on, itables_to_merge, ijoin_on_tables,
                iimportant_tablenames, iexcluded, itablemap
            ) = self._build_joins_for_select(tablemap, join)
            tablemap = merge_tablemaps(tablemap, itables_to_merge)
            tablemap = merge_tablemaps(tablemap, itablemap)
        if left:
            (
                join_tables, join_on, tables_to_merge, join_on_tables,
                important_tablenames, excluded, jtablemap
            ) = self._build_joins_for_select(tablemap, left)
            tablemap = merge_tablemaps(tablemap, tables_to_merge)
            tablemap = merge_tablemaps(tablemap, jtablemap)


So itables_to_merge get altered and get back to is previous state as it is at some point in _build_joins_for_select() (in red), but it was filtered in the stage in blue  :

def _build_joins_for_select(self, tablenames, param):
        if not isinstance(param, (tuple, list)):
            param = [param]
        tablemap = {}
        for item in param:
            if isinstance(item, Expression):
                item = item.first
            key = item._tablename
            if tablemap.get(key, item) is not item:
                raise ValueError('Name conflict in table list: %s' % key)
            tablemap[key] = item
        join_tables = [
            t._tablename for t in param if not isinstance(t, Expression)
        ]
        join_on = [t for t in param if isinstance(t, Expression)]
        tables_to_merge = {}
        for t in join_on:
            tables_to_merge = merge_tablemaps(tables_to_merge, self.tables(t))
        join_on_tables = [t.first._tablename for t in join_on]
        for t in join_on_tables:
            print t
            if t in tables_to_merge:
                print t
                tables_to_merge.pop(t)
        important_tablenames = join_tables + join_on_tables + \
            list(tables_to_merge)
        excluded = [
            t for t in tablenames if t not in important_tablenames
        ]
        return (
            join_tables, join_on, tables_to_merge, join_on_tables,
            important_tablenames, excluded, tablemap
        )


With the logic in merge_tablemaps() where things are reversed in big and small and big get update at the end it explains why itables_to_merge get modified by merge_tablemaps() 

def merge_tablemaps(*maplist):
    """Merge arguments into a single dict, check for name collisions.
    Arguments may be modified in the process."""
    ret = maplist[0]
    for item in maplist[1:]:
        if len(ret) > len(item):
            big, small = ret, item
        else:
            big, small = item, ret
        # Check for name collisions
        for key, val in small.items():
            if big.get(key, val) is not val:
                raise ValueError('Name conflict in table list: %s' % key)
        # Merge
        big.update(small)
        ret = big
    return ret

I don't think itables_to_merge is updated intentionally because why filtering it in _build_joins_for_select()...

My guess is the intention wasn't to get it updated and the only purpose of the  tablemap with all the tables names as itablemap use lack some(s) of them...

So deepcopy would be need it or just dict(**itables_to_merge)) while passing itables_to_merge to merge_tablemaps()

Should we fix that??

        if join:
            (
                # FIXME? ijoin_tables is never used
                ijoin_tables, ijoin_on, itables_to_merge, ijoin_on_tables,
                iimportant_tablenames, iexcluded, itablemap
            ) = self._build_joins_for_select(tablemap, join)
            tablemap = merge_tablemaps(tablemap, dict(**itables_to_merge))
            tablemap = merge_tablemaps(tablemap, itablemap)
        if left:
            (
                join_tables, join_on, tables_to_merge, join_on_tables,
                important_tablenames, excluded, jtablemap
            ) = self._build_joins_for_select(tablemap, left)
            tablemap = merge_tablemaps(tablemap, dict(**tables_to_merge))
            tablemap = merge_tablemaps(tablemap, jtablemap)


Richard Vézina

unread,
Feb 28, 2018, 10:13:46 AM2/28/18
to web2py-users
Here the issue and a PR : https://github.com/web2py/pydal/pull/523

Please including it in the next release if it don't break anything... It will help with backward (empty query) compatibility...

Thanks

Richard

pbreit

unread,
Mar 2, 2018, 1:56:55 PM3/2/18
to web2py-users
Thanks. I've already cloned. But remained confused how to update correctly. Normally I would just "git pull" but am not sure if I need to do something else to make sure DAL updated, too.

Val K

unread,
Mar 3, 2018, 3:55:29 AM3/3/18
to web2py-users
tried web2py_on_gevent.exe

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "__main__.py", line 128, in <module>
  File "__main__web2py_on_gevent__.py", line 21, in <module>
  File "gevent/monkey.py", line 190, in patch_all
  File "gevent/monkey.py", line 146, in patch_ssl
  File "gevent/monkey.py", line 62, in patch_module
  File "gevent/ssl.py", line 15, in <module>
  File "ssl.py", line 97, in <module>
ImportError: No module named _ssl

Richard Vézina

unread,
Mar 5, 2018, 10:31:38 AM3/5/18
to web2py-users
@pbreit, I think that if you clone recursive at start pull will be enough to update you envrionement... You can assess which version of the pyDAL you have once you pull, just go in gluon/packages/dal/CHANGES and check which version is mention in the last change log there...

You can compare what is mention in web2py/CHANGELOG file... It appears to be the only place where the link is establish about what is the given pyDAL version that should be attached to a given version of web2py... I don't find that very neat as if it got forgotten we don't have a proper way to assess that we have the proper pyDAL version...

Richard

On Fri, Mar 2, 2018 at 1:56 PM, pbreit <pbreit...@gmail.com> wrote:
Thanks. I've already cloned. But remained confused how to update correctly. Normally I would just "git pull" but am not sure if I need to do something else to make sure DAL updated, too.

--

Nbush

unread,
Mar 7, 2018, 5:31:14 PM3/7/18
to web2py-users
Pluralizaiton error. (test on python 2.7.13)


<type 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Function argument list

(self=<gluon.languages.translator object>, message='%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]} 1 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}', symbols=(1,))

Code listing
929.
930.
931.
932.
933.
934.

935.
936.
937.
938.
                part = regex_plural_dict.sub(sub_dict, s)
if part == s:
return m.group(0)
return part
message = message % symbols
message = regex_plural.sub(sub_plural, message)

return message

def translate(self, message, symbols):
"""
Variables
message'%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]} 1 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}'
global regex_plural<_sre.SRE_Pattern object>
regex_plural.sub<built-in method sub of _sre.SRE_Pattern object>
sub_plural<function sub_plural>

Paolo

unread,
Mar 11, 2018, 6:47:04 AM3/11/18
to web2py-users
@nbush, could you post a code snippet to reproduce the error? Which web2py version have you tested?

Nbush

unread,
Mar 11, 2018, 3:45:14 PM3/11/18
to web...@googlegroups.com
@Paolo
python 2.7
in apps welcome
in models/db.py add

T.force('ru')

go admin db

../welcome/appadmin/select/db?query=db.auth_user.id>0

oops

Internal error


If the browser language is English, everything works fine
If the browser language is Russian, plural form causes an error

воскресенье, 11 марта 2018 г., 13:47:04 UTC+3 пользователь Paolo написал:

Paolo Valleri

unread,
Mar 18, 2018, 3:40:20 AM3/18/18
to web...@googlegroups.com
@nbush would you open an issue on https://github.com/web2py/web2py/issues. It seems that languages files were wrongly updated into decoded messages. see https://github.com/web2py/web2py/commit/9263f8c4c3be7dd3ac0d1e9948c23b52f10db0d0#diff-59abf7aaebbac65b540eaebf36870ec6

 Paolo

2018-03-11 20:45 GMT+01:00 Nbush <nbus...@gmail.com>:
@Paolo
in apps welcome
in models/db.py add

T.force('ru')

go admin db

../welcome/appadmin/select/db?query=db.auth_user.id>0

oops

If the browser language is English, everything works fine

--
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/qN5RR-QuhbQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
Message has been deleted

Massimo Di Pierro

unread,
Mar 28, 2018, 12:38:37 PM3/28/18
to web2py-users
can you please provide the final traceback from the erro ticket?

Carlos Cesar Caballero Díaz

unread,
Apr 22, 2018, 8:05:31 PM4/22/18
to web...@googlegroups.com
Hi, I was testing and there are some issues with the DAL parse_as_rest and Python 3. There are also some style issues with the welcome app navbar.

I can work in the navbar if no one is working.

Greetings.


El 24/02/18 a las 21:44, Massimo Di Pierro escribió:
Please help us test the version of web2py which is posted on github.

I would like to release a new stable version and I would like to know if any of the changes has broken backward compatibility.
Also the icons are back in the latest welcome but use font-awesome.

Please check it. Thanks.

Massimo

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Massimo Di Pierro

unread,
Apr 24, 2018, 6:05:49 PM4/24/18
to web2py-users
please do even be aware that in trunk bs4 we no longer use the auth.navbar() I think the code is more transparent to new users without it. We may deprecate it.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages