Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Captura de recursos do subsídio SPPO #203

Closed
wants to merge 88 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
b86df43
add captura recursos
fernandascovino Sep 30, 2022
b373c63
add status column
fernandascovino Sep 30, 2022
aee0630
fix and register flows
fernandascovino Sep 30, 2022
4a19ece
add log and fix map
fernandascovino Oct 3, 2022
f74b3c8
change url and get_raw to get values from customfields (#208)
gmartinsoc Oct 3, 2022
e82db43
fix task source
fernandascovino Oct 3, 2022
8348671
add init
fernandascovino Oct 3, 2022
134f929
remove old fields dict
fernandascovino Oct 3, 2022
249fff6
minor fixes
Hellcassius Oct 4, 2022
bf6ee94
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 5, 2022
844122b
fix lint and remove treatment - moved to dbt
fernandascovino Oct 5, 2022
6b1c600
add status to capture + hotfix
fernandascovino Oct 5, 2022
6b5e7a5
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 6, 2022
48575b1
fix data column + status iteration
fernandascovino Oct 6, 2022
1e30fe2
fix pylint
fernandascovino Oct 6, 2022
afe2ece
fix list
fernandascovino Oct 6, 2022
ab653e4
fix status
fernandascovino Oct 6, 2022
a1b7f35
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 6, 2022
1692f22
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 7, 2022
286b23e
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 13, 2022
d919649
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 13, 2022
c9bffec
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 13, 2022
e019a00
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 17, 2022
c4d4965
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 17, 2022
edb212e
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 18, 2022
5151ccd
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 18, 2022
1084711
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 18, 2022
c8cb384
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 18, 2022
86bbd7a
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 19, 2022
1443d21
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 19, 2022
19c14b6
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 19, 2022
fa52df3
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 21, 2022
83ac1fd
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 21, 2022
bcab2d1
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 24, 2022
f22d1df
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 24, 2022
fa163c9
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 24, 2022
40c5c84
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 24, 2022
e8bb389
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 24, 2022
895f6d1
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 25, 2022
613d14e
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 28, 2022
467ad92
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Oct 28, 2022
39faa50
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 3, 2022
a982895
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 4, 2022
9fdeeb2
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 4, 2022
1e00014
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 4, 2022
e13399b
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
701607e
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
e0e7aeb
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
bf9dfd5
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
4842149
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
02cbc65
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
006a31a
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
18817ff
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
6d80c7a
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
15fbd6c
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
2f276da
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
1311321
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
ca73cb7
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
63905fa
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 7, 2022
2d5bccf
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 8, 2022
826069b
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 8, 2022
6a9e771
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 8, 2022
34b69ae
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 9, 2022
8c58893
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 10, 2022
352f4ca
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 17, 2022
20a0bf6
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 17, 2022
db76a00
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 17, 2022
ec5b594
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 17, 2022
ea5b909
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 18, 2022
3cefd9c
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 18, 2022
9f56397
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 22, 2022
c736cb9
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 22, 2022
38a2b9a
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 23, 2022
426e1eb
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 23, 2022
63c11e3
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 23, 2022
d1ec13d
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 23, 2022
2978cda
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 24, 2022
88e4aa7
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 25, 2022
1f7264a
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 25, 2022
7d4f18b
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 29, 2022
2fae856
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 30, 2022
71d404e
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 30, 2022
a44b988
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 30, 2022
baf8025
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Nov 30, 2022
0041cbb
Merge branch 'master' into staging/smtr-subsidio-sppo-recursos
mergify[bot] Dec 6, 2022
affb7ce
conflitos resolvidos
lingsv Oct 26, 2023
00df392
Revert "conflitos resolvidos"
lingsv Oct 26, 2023
ac409fc
revert do merge
lingsv Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[flake8]
ignore = E203,F401,F403,W503
exclude =
*cookiecutter*
max-line-length = 100
3 changes: 1 addition & 2 deletions .github/workflows/cd_staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ env:

jobs:
build-container:
if: startsWith(github.head_ref, 'staging/') || contains( github.event.pull_request.labels.*.name, 'staging')
if: startsWith(github.head_ref, 'staging/')
name: Register flows (staging)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ jobs:
with:
message: "${{ steps.code-tree-analysis.outputs.pr-message }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
pytest
21 changes: 16 additions & 5 deletions .github/workflows/lint_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9.x"
python-version: "3.8.x"
- name: Set up Poetry and upgrade pip
run: |
pip install -U pip poetry
- name: Install flows
run: |
poetry install
- name: Lint with flake8
run: |
poetry run lint
pip install --prefer-binary .
- name: Lint flows
uses: gabriel-milan/action-pylint@v1
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
path: "pipelines/"
fail: true
pr-message: true
- name: Lint tests
uses: gabriel-milan/action-pylint@v1
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
path: "tests/"
fail: true
pr-message: true
2 changes: 1 addition & 1 deletion .github/workflows/scripts/code_tree_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def identify_code_owners(files: List[str]) -> List[str]:


if __name__ == "__main__":

# Assert arguments.
if len(sys.argv) not in [2, 3]:
print(f"Usage: python {sys.argv[0]} <changed_files> [--write-to-file]")
Expand All @@ -464,7 +465,6 @@ def identify_code_owners(files: List[str]) -> List[str]:
if file_.endswith(".py")
and file_.startswith("pipelines")
and "cookiecutter" not in file_
and Path(file_).exists()
]
print("We're interested in these files:")
for file_ in changed_files:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/scripts/register_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,7 @@ def build_and_register( # pylint: disable=too-many-branches
while attempts < max_retries:
attempts += 1
try:
(
flow_id,
flow_version,
is_new,
) = register_serialized_flow(
(flow_id, flow_version, is_new,) = register_serialized_flow(
client=client,
serialized_flow=serialized_flow,
project_id=project_id,
Expand Down Expand Up @@ -484,8 +480,8 @@ def get_affected_flows(fpath: str = None):
for flow in declared_flows:
try:
flows.append(eval(flow))
except Exception as exc:
logger.exception(f"Could not evaluate {flow}: {exc}")
except Exception:
logger.warning(f"Could not evaluate {flow}")
return flows


Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ replit.nix
test_local.py
pylint.txt
test.py
test/*
test/*.ipynb
test/*.csv
setup.py
.vscode/*
*.hdf
*.DS_Store


# Byte-compiled / optimized / DLL files
Expand Down
29 changes: 15 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files # prevents adding large files
- id: detect-private-key # detects private keys
- id: fix-byte-order-marker # fixes BOM
- id: fix-encoding-pragma # fixes encoding pragma
- id: no-commit-to-branch # prevents committing to protected branches
- id: trailing-whitespace # prevents trailing whitespace
- repo: https://github.com/psf/black
rev: 23.7.0
- id: check-added-large-files # prevents adding large files
- id: detect-private-key # detects private keys
- id: fix-byte-order-marker # fixes BOM
- id: fix-encoding-pragma # fixes encoding pragma
- id: no-commit-to-branch # prevents committing to protected branches
- id: trailing-whitespace # prevents trailing whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- id: black
language_version: python3.9
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
exclude: 'pipelines\/\{\{cookiecutter\.project_name\}\}.*'
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- id: flake8
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fail-on=
fail-under=10.0

# Files or directories to be skipped. They should be base names, not paths.
ignore=
ignore={{cookiecutter.project_name}}

# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths.
Expand Down
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use o IntelliSense para saber mais sobre os atributos possíveis.
// Focalizar para exibir as descrições dos atributos existentes.
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Arquivo Atual",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
91 changes: 0 additions & 91 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
**Attention:** This repository contains part of the code under the GPL-3.0 license and part under an EULA license.
All code under the EULA license will have a header indicating that it is proprietary.
See the respective topics under LICENSE for the terms and conditions of each license.


GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Expand Down Expand Up @@ -677,89 +672,3 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


###########################################################################


END USER LICENSE AGREEMENT (EULA)

IMPORTANT - PLEASE READ CAREFULLY BEFORE DOWNLOADING, INSTALLING OR USING
ANY PART OF THIS CODE:

This End User License Agreement ("EULA") is entered into between the
Municipality of Rio de Janeiro ("Licensor") and any individual or entity
that downloads, installs or uses Licensor code ("Licensee") made available in
this directory and in its subdirectories.

BY DOWNLOADING, INSTALLING, COPYING OR USING ANY PART OF THIS CODE, YOU
AGREE TO BE BOUND BY THE TERMS OF THIS EULA. IF YOU DO NOT AGREE TO THE TERMS
OF THIS EULA, DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.


1. License Grant.

Licensor grants Licensee a non-exclusive, non-transferable license to
use this code for personal or commercial purposes, subject to the terms and
conditions of this Agreement. This license does not grant you the right to
distribute, modify, rent, lease or sublicense the product.


2. Restrictions

Licensee may not reproduce, distribute, modify, reverse engineer, create
derivative works or otherwise use or exploit any part of this code, particularly
that which is specifically identified by Licensor as proprietary or confidential
information ("Restricted Code"). Licensee acknowledges that any breach of this
restriction may cause Licensor irreparable harm and that Licensor may seek
injunctive relief in addition to any other available legal or equitable remedies.


3. Property right

The Product is the property of Licensor and is protected by copyright laws and
international treaty provisions. Licensor retains all right, title and interest in
and to the Code, including all intellectual property rights therein. You agree to
protect the Product from unauthorized use, reproduction or distribution. This
Agreement does not transfer any ownership rights to Licensee.


4. Limitation of Liability

IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
CONSEQUENTIAL OR PUNITIVE DAMAGES, OR ANY DAMAGES RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHERWISE, ARISING OUT
OF OR IN CONNECTION WITH WITH THE USE OR PERFORMANCE OF THE PRODUCT.


5. Disclaimer of Warranties

THE PRODUCT IS PROVIDED WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LICENSOR DOES NOT WARRANT THAT THE
PRODUCT WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE PRODUCT WILL BE
UNINTERRUPTED OR ERROR-FREE.


6. Applicable law

This EULA will be governed by and constructed in accordance with the laws of
the state of Rio de Janeiro, without giving effect to any choice of law or conflict
of law provisions.


7. Total agreement

This Agreement constitutes the entire agreement between the parties with
respect to the subject matter herein and supersedes all prior or contemporaneous
communications and proposals, oral or written, between the parties.


By downloading, installing or using the code, Licensee acknowledges that
Licensee has read and understood this Agreement and agrees to be bound by its
terms and conditions.

If you have any questions about this EULA or the Product, please contact us
at [email protected]

END OF TERMS AND CONDITIONS
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ da Prefeitura do Rio de Janeiro. O repositório é gerido pelo Escritório
Municipal de Dados (EMD) e alimentado de forma colaborativa com as equipes de
dados e tecnologia das Secretarias.


> 💜 Todo o código é desenvolvido em Python utilizando o software livre [Prefect](https://prefect.io/).

## Configuração de ambiente para desenvolvimento
Expand All @@ -16,12 +17,6 @@ dados e tecnologia das Secretarias.
- `pip`
- (Opcional, mas recomendado) Um ambiente virtual para desenvolvimento (`miniconda`, `virtualenv` ou similares)

### Licenças

Este repositório contém parte do código sob a licença GPL-3.0 e parte sob uma licença EULA.
Todo código sob a licença EULA terá um cabeçalho indicando que é proprietário.
Consulte os respectivos tópicos em LICENÇA para os termos e condições de cada licença.

### Procedimentos

- Clonar esse repositório
Expand Down Expand Up @@ -93,7 +88,7 @@ constants.py # valores constantes para todos os órgãos

```

### Adicionando órgãos e projetos (descontinuado)
### Adicionando órgãos e projetos

O script `manage.py` é responsável por criar e listar projetos desse repositório. Para usá-lo, no entanto, você deve instalar as dependências em `requirements-cli.txt`:

Expand Down
1 change: 1 addition & 0 deletions backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def create_timestamp_parameters(


if __name__ == "__main__":

timestamp_parameters = create_timestamp_parameters(
start=BACKFILL_START,
end=BACKFILL_END,
Expand Down
3 changes: 0 additions & 3 deletions code_owners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ pipelines:
- hellcassius
- fernandascovino
- eng-rodrigocunha
- borismarinho
- pixuimpou
- lingsv
rj_escritorio:
owners:
- gabriel-milan
Expand Down
Loading