Projet

Général

Profil

Development #41814

AttributeError: filter_value

Ajouté par Sentry Io il y a environ 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
17 avril 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

https://sentry.entrouvert.org/entrouvert/publik/issues/1543/

AttributeError: filter_value
(48 additional frame(s) were not displayed)
...
  File "bijoe/visualization/utils.py", line 209, in table_1d
    data = self.data()
  File "bijoe/visualization/utils.py", line 162, in data
    [self.measure]))
  File "bijoe/engine.py", line 435, in query
    sql = self.sql_query(filters=filters, drilldown=drilldown, measures=measures, **kwargs)
  File "bijoe/engine.py", line 386, in sql_query
    condition, values = dimension.build_filter(values)
  File "bijoe/schemas.py", line 268, in build_filter
    value = self.filter_value or self.value

Internal Server Error: /visualization/warehouse/formulaires_chemdata_test_entrouvert_org/all_formdata/

Fichiers

0001-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch (694 octets) 0001-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch Benjamin Dauvergne, 17 avril 2020 12:04
0004-update-.gitignore-41814.patch (468 octets) 0004-update-.gitignore-41814.patch Benjamin Dauvergne, 17 avril 2020 19:02
0001-engine-get-fact-table-from-configuration-41814.patch (1,03 ko) 0001-engine-get-fact-table-from-configuration-41814.patch Benjamin Dauvergne, 17 avril 2020 19:02
0002-tests-add-test-on-JSON-dimensions-41814.patch (5,86 ko) 0002-tests-add-test-on-JSON-dimensions-41814.patch Benjamin Dauvergne, 17 avril 2020 19:02
0003-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch (698 octets) 0003-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch Benjamin Dauvergne, 17 avril 2020 19:02
0004-update-.gitignore-41814.patch (468 octets) 0004-update-.gitignore-41814.patch Benjamin Dauvergne, 20 avril 2020 20:17
0005-tests-remove-dead-test-41814.patch (3,56 ko) 0005-tests-remove-dead-test-41814.patch Benjamin Dauvergne, 20 avril 2020 20:17
0001-engine-get-fact-table-from-configuration-41814.patch (1,03 ko) 0001-engine-get-fact-table-from-configuration-41814.patch Benjamin Dauvergne, 20 avril 2020 20:17
0002-tests-add-test-on-JSON-dimensions-41814.patch (5,86 ko) 0002-tests-add-test-on-JSON-dimensions-41814.patch Benjamin Dauvergne, 20 avril 2020 20:17
0003-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch (784 octets) 0003-misc-call-parent-s-init-in-SchemaJSONDimension-41814.patch Benjamin Dauvergne, 20 avril 2020 20:17

Demandes liées

Dupliqué par BiJoe - Bug #42756: sur action sur visualisation, AttributeError: filter_valueFermé12 mai 2020

Actions

Révisions associées

Révision 7cab96b9 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

engine: get fact table from configuration (#41814)

Révision 46b5349f (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

tests: add test on JSON dimensions (#41814)

Révision be2c08a6 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: call parent's init in SchemaJSONDimension (#41814)

Broken by:

9a4d84a python3: avoid slots conflicts with class variable (#40570)

Révision 25d7c7fd (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

update .gitignore (#41814)

Révision c7ebf400 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

tests: remove dead test (#41814)

The deleted test used a dimension "retard_stat" which was not defined on
the target cube, but worked nonetheless since the list of JSON
dimensions was wrongly computed from a table named "formdata" and not
the fact table of the used cube, which is now fixed.

Historique

#1

Mis à jour par Lauréline Guérin il y a environ 4 ans

  • Projet changé de Suivi des traces à BiJoe
#2

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

  • Assigné à mis à Benjamin Dauvergne
#3

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

Manque un test mais je regarde déjà si ça ne casse rien.

#4

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

  • Statut changé de Solution proposée à En cours
#6

Mis à jour par Paul Marillonnet il y a environ 4 ans

(C'est toujours rouge côté Jenkins.)

#7

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Solution proposée à En cours
#9

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Paul Marillonnet a écrit :

(C'est toujours rouge côté Jenkins.)

Pour l'explication en fait le bug que j'ai trouvé au passage était plus embêtant que ce que je pensais, il laissait voir des dimensions dues à la colonne JSON qui normalement ne devraient exister que sur le cube "Tous les formulaires" et dans la fixture schema2 il y a justement une visualisation mal configurée qui utilisait une telle dimension, d'où le changement dans les résultats quand ça a été corrigé. J'ai retiré cette visualisation erronée.

#10

Mis à jour par Nicolas Roche il y a presque 4 ans

Du fait que ton test ne reproduit pas le chemin emprunté par la trace ci-dessus, j'ai du mal à comprendre comment le passage dans l'__init__ de Dimension aide à construire le filtre.
(Je bien encore une autre piste, à moins que quelqu'un passe par là entre temps)

Je pensais à une histoire de slots non hérités mais ça ne semble pas être ça.

You must remember to redeclare slots in each subclass, because the inherited attribute is ignored by the interpreter.

#11

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Nicolas Roche a écrit :

Du fait que ton test ne reproduit pas le chemin emprunté par la trace ci-dessus, j'ai du mal à comprendre comment le passage dans l'__init__ de Dimension aide à construire le filtre.
(Je bien encore une autre piste, à moins que quelqu'un passe par là entre temps)

Je pensais à une histoire de slots non hérités mais ça ne semble pas être ça.

You must remember to redeclare slots in each subclass, because the inherited attribute is ignored by the interpreter.

Oui c'est ça c'est une correction py3 que tu as faite mais qui casse le comportement précédent :

    python3: avoid __slots__ conflicts with class variable (#40570)

avant on dépendait des valeurs par défaut au niveau des classes en déplaçant cette initialisation dans init() sans ajouter d'appel à super().__init__() dans toutes les classes filles (ce que je fais dans 0003 avec SchemaJSONDimesnion) tu as cassé le fonctionnement de SchemaJSONDimension dans build_filter().

En ajoutant le test dans le 0002 pour vérifier cette correction, ça a levé le bug corrigé dans 0001 (c'est pas dans l'ordre chronologique désolé).

#12

Mis à jour par Nicolas Roche il y a presque 4 ans

  • Statut changé de Solution proposée à Solution validée

Merci, je suis passé à côté.

224          def __init__(self, json_field, name):
225              import pdb; pdb.set_trace()
226  ->            super(SchemaJSONDimension, self).__init__()

(Pdb) self.filter_value
*** AttributeError: filter_value

(Pdb) n
(Pdb) str(self.filter_value)
'None'

#13

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Dupliqué par Bug #42756: sur action sur visualisation, AttributeError: filter_value ajouté
#14

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit c7ebf4003998e4cfffcaef49e041c6d5779a26f9
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Mon Apr 20 20:15:26 2020 +0200

    tests: remove dead test (#41814)

    The deleted test used a dimension "retard_stat" which was not defined on
    the target cube, but worked nonetheless since the list of JSON
    dimensions was wrongly computed from a table named "formdata" and not
    the fact table of the used cube, which is now fixed.

commit 25d7c7fd820f3f9bbfa675c185a4e5c22a05a312
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 17 18:56:11 2020 +0200

    update .gitignore (#41814)

commit be2c08a6f1a9919aa1d2d4f9229e1ab0183da7e4
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 17 12:03:50 2020 +0200

    misc: call parent's init in SchemaJSONDimension (#41814)

    Broken by:

      9a4d84a python3: avoid __slots__ conflicts with class variable (#40570)

commit 46b5349f93339cdb76a5f1d75f898468a3bb5f51
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 17 18:55:54 2020 +0200

    tests: add test on JSON dimensions (#41814)

commit 7cab96b98968086956d103f36ac6c72b9fad8d49
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 17 18:55:25 2020 +0200

    engine: get fact table from configuration (#41814)
#15

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF