Skip to content

Commit

Permalink
Merge pull request #86 from fabianazioti/b-0.8
Browse files Browse the repository at this point in the history
🐛 adapty row type close #85
  • Loading branch information
fabianazioti authored Nov 17, 2023
2 parents b24bdd1 + 001d037 commit efdeb2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 2 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
..
This file is part of LCCS-WS.
Copyright (C) 2022 INPE.
Copyright (C) 2023 INPE.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -25,10 +25,6 @@ Land Cover Classification System Web Service
:target: https://github.com/brazil-data-cube/bdc-catalog/blob/master/LICENSE
:alt: Software License

.. image:: https://drone.dpi.inpe.br/api/badges/brazil-data-cube/lccs-ws/status.svg
:target: https://drone.dpi.inpe.br/brazil-data-cube/lccs-ws
:alt: Build Status

.. image:: https://codecov.io/gh/brazil-data-cube/lccs-ws/branch/master/graph/badge.svg?token=XFD6QREW99
:target: https://codecov.io/gh/brazil-data-cube/lccs-ws
:alt: Code Coverage Test
Expand Down Expand Up @@ -95,7 +91,7 @@ License


.. admonition::
Copyright (C) 2022 INPE.
Copyright (C) 2023 INPE.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 7 additions & 3 deletions lccs_ws/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,18 @@ def get_mappings(system_id_or_identifier: str) -> Tuple[LucClassificationSystem,
classes_source = db.session.query(LucClass.id) \
.filter(LucClass.classification_system_id == system.id) \
.all()

classes_source_ids = [value for (value,) in classes_source]

targets_class_id = db.session.query(distinct(ClassMapping.target_class_id)) \
.filter(ClassMapping.source_class_id.in_(classes_source)) \
targets_classes = db.session.query(distinct(ClassMapping.target_class_id)) \
.filter(ClassMapping.source_class_id.in_(classes_source_ids)) \
.all()

targets_class_ids = [value for (value,) in targets_classes]

systems = db.session.query(LucClassificationSystem) \
.join(LucClass, LucClass.classification_system_id == LucClassificationSystem.id) \
.filter(LucClass.id.in_(targets_class_id)) \
.filter(LucClass.id.in_(targets_class_ids)) \
.all()

return system, systems
Expand Down

0 comments on commit efdeb2c

Please sign in to comment.