chat.freenode.net #tryton log beginning Wed 13 May 2020 12:00:01 AM CEST | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 22:40 | |
-!- thaneor(~ldlc6@r186-55-20-104.dialup.adsl.anteldata.net.uy) has joined #tryton | 02:07 | |
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton | 04:46 | |
-!- mrichez(~Maxime@2a02:a03f:467c:d500:a385:4ecf:c4ea:d8cf) has joined #tryton | 05:35 | |
-!- rpit(~rpit@p4FFB760E.dip0.t-ipconnect.de) has joined #tryton | 06:14 | |
semarie | what is the way to make tox to avoid cloning from https://hg.tryton.org/ but using local repositories ? | 06:45 |
---|---|---|
pokoli | semarie: if you've cloned tryton-env you can run tryton tests with: python -m trytond.tests.run-tests -m <module_name> | 07:11 |
pokoli | semarie: this runs the tests from sources without installing anything | 07:12 |
semarie | I have a local tryton-env clone, but I keep it clean and I work in cloned modules (outside tryton-env) | 07:16 |
semarie | keeping it clean permit me to control what I put in production :) | 07:17 |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:34 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton | 08:00 | |
-!- Timitos(~kpreisler@2001:a61:400:901:762b:62ff:fe84:ed7e) has joined #tryton | 08:16 | |
pokoli | semarie: and how do you install dependencies? | 08:29 |
semarie | pokoli: I am running tox with --sitepackages. dependencies are installed system wide (as I am running trytond locally for testing purpose) | 09:13 |
pokoli | semarie: I mean internall dependencies, i.e: Other tryton modules | 09:23 |
pokoli | semarie: you clone also in the cloned modules? | 09:23 |
semarie | oh | 09:23 |
semarie | it is the problem. tox clone them from internet | 09:23 |
semarie | from tox point of vue, I have only a cloned module. so when running, tox installs it and all dependencies (cloned from hg.tryton.org) before running tests | 09:25 |
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton | 09:38 | |
-!- mariomop(~quassel@190.193.24.15) has joined #tryton | 10:56 | |
semarie | I have an odd behaviour with sqlite: my column is defined as FirstValue(statement.end_balance, window=w).as_('last_amount') and fetchall() returns to me bytes() | 11:31 |
semarie | the usual idiom for sqlite is: if not isinstance(var, Decimal): var = Decimal(str(var)) | 11:32 |
semarie | but here with bytes() : str(b'80') => "b'80'" | 11:32 |
semarie | and Decimal fails with decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>] | 11:32 |
cedk | semarie: only for this field? | 11:35 |
semarie | I haven't check others fields if bytes() or str() | 11:35 |
semarie | I will do it | 11:35 |
cedk | semarie: SQLite tries to interpret the type from the value | 11:37 |
cedk | semarie: sometimes it may help to force the cast | 11:38 |
semarie | others seems fine: 1 2020-05-13 b'80' / but it is: int, date, numeric | 11:40 |
semarie | I will try with a Cast | 11:40 |
cedk | semarie: by the way, we define has_window_functions as false for SQLite | 11:42 |
cedk | I think you should not use window function with SQLite | 11:44 |
semarie | :-( | 11:45 |
cedk | windows function on SQLite is still quite recent: https://www.sqlite.org/windowfunctions.html#history | 11:46 |
semarie | I am currently looking at https://sqlite.org/windowfunctions.html#biwinfunc | 11:46 |
cedk | and I bet the casting is not yet good enough | 11:46 |
semarie | ah. I think a found a bug in python-sql | 11:51 |
semarie | Cast(FirstValue(statement.end_balance, window=w).as_('last_amount'), Statement.end_balance.sql_type().base) => CAST("last_amount" AS NUMERIC) | 11:52 |
semarie | I will move the .as_() | 11:53 |
cedk | semarie: it is not a valid expression, the "AS" should always be the last call | 11:53 |
semarie | yes, it is better with .as_() last | 11:54 |
semarie | and the Cast() seems to do right things | 11:55 |
cedk | reading https://www.sqlite.org/datatype3.html#type_affinity the problem may come from NULL value stored in this column | 11:56 |
cedk | semarie: but any way, you should provide an implementation also without window function (we do not care if it is less performent) | 11:57 |
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton | 12:05 | |
-!- lucas__(~lucascast@177-185-139-41.isotelco.net.br) has joined #tryton | 12:05 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 12:11 | |
-!- thaneor1(~ldlc6@r186-55-19-1.dialup.adsl.anteldata.net.uy) has joined #tryton | 14:09 | |
-!- udono1(~udono@121-131-067-156.ip-addr.inexio.net) has joined #tryton | 14:21 | |
-!- udono(~udono@048-135-067-156.ip-addr.inexio.net) has joined #tryton | 14:39 | |
semarie | I think I have a cache/depends issue with my Function field in 'account.statement.journal' : the value is computed from 'account.statement'. how to add a depend for that in order to let know tryton when to refresh ? | 14:53 |
cedk | semarie: I do not understand the problem | 15:10 |
semarie | cedk: using tests scenarios to check account_journal.last_date value, it keep the first value tested | 15:13 |
semarie | if my first test is just after journal creation, the value is None (right), and for further tests it is always None (wrong) | 15:14 |
cedk | semarie: you must call reload on the record | 15:14 |
cedk | like you would do with the client | 15:14 |
semarie | arg | 15:14 |
semarie | at lest, it would be more simple. thanks :) | 15:15 |
semarie | least* | 15:15 |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 16:01 | |
-!- thaneor(~ldlc6@r186-55-19-1.dialup.adsl.anteldata.net.uy) has joined #tryton | 16:08 | |
-!- josesalvador(~josesalva@170.253.40.186) has joined #tryton | 18:10 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton | 19:23 | |
-!- umekalu(~abraham@197.210.227.59) has joined #tryton | 19:47 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!