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

Replace Unidecode #24

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Replace Unidecode #24

merged 8 commits into from
Mar 11, 2024

Conversation

gabrielguarisa
Copy link
Collaborator

@gabrielguarisa gabrielguarisa commented Mar 11, 2024

This PR makes the following changes:

  • Removes the unidecode library;
  • Standardizes exceptions to return a message similar to the one shown below:
{
  "title": "Execution error",
  "detail": {
    "msg": "Error executing a sub-rule node 2 from rule example.json version 9116848f00.2024-03-06",
    "type_": "ExecutionException",
    "exception": {
      "msg": {
        "title": "Execution error",
        "detail": {
          "msg": "Error executing node 4 from rule None version 03f1c81a79.dynamic",
          "type_": "ExecutionException",
          "exception": {
            "msg": "could not convert string to float: 'a'",
            "exception_type": "ValueError"
          }
        },
        "status": "500",
        "metadata": {
          "name": null,
          "version": "03f1c81a79.dynamic",
          "node_id": "4",
          "execution": {
            "payload": {
              "frequency": { "0": "a" },
              "market_value_cents": { "0": "8887300" },
              "user_age": { "0": "23" },
              "uf": { "0": "BA" }
            },
            "states": {
              "2@output_value": { "0": "a" },
              "3@output_value": { "0": "8887300" },
              "output": { "0": null },
              "message": { "0": null }
            },
            "filters": {},
            "result": { "output": { "0": null }, "message": { "0": null } },
            "has_ended": false
          }
        }
      },
      "exception_type": "ExecutionException"
    }
  },
  "status": "500",
  "metadata": {
    "name": "example.json",
    "version": "9116848f00.2024-03-06",
    "node_id": "2",
    "execution": {
      "payload": {
        "frequency": { "0": "a" },
        "market_value_cents": { "0": "8887300" },
        "user_age": { "0": "23" },
        "uf": { "0": "BA" }
      },
      "states": {
        "6@output_value": { "0": "a" },
        "7@output_value": { "0": "8887300" },
        "8@output_value": { "0": "23" },
        "9@output_value": { "0": "BA" },
        "11@output_value": { "0": "8887300" },
        "output": { "0": null },
        "message": { "0": null }
      },
      "filters": {},
      "result": { "output": { "0": null }, "message": { "0": null } },
      "has_ended": false
    }
  }
}

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py46589%29, 69, 79, 86, 89
   executor.py951188%59, 71–72, 129, 173, 214–221, 227
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py13285%15–35
   graph.py55885%34, 44, 54, 56, 58, 69, 74, 76
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11286994% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.439s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py46589%29, 69, 79, 86, 89
   executor.py951188%59, 71–72, 129, 173, 214–221, 227
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py13285%15–35
   graph.py55885%34, 44, 54, 56, 58, 69, 74, 76
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11286994% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.206s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28968%17–18, 22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11568193% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.368s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28775%22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11567993% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.359s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28775%22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11567993% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.394s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28968%17–18, 22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11568193% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.305s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28968%17–18, 22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11568193% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.400s ⏱️

Copy link

coverage

Coverage Report
FileStmtsMissCoverMissing
retrack/engine
   base.py49688%30, 70, 79, 83, 90, 93
   executor.py1041586%59, 71–72, 129, 173, 213, 225–242, 248
   request_manager.py67790%17, 36, 53, 67–68, 146, 149
   rule.py49296%78, 99
retrack/nodes
   check.py41393%23, 26, 89
   connectors.py17194%27
   constants.py76396%113, 116, 143
   math.py43198%75
retrack/nodes/dynamic
   base.py16194%26
   csv_table.py43295%59, 62
   flow.py41198%18
retrack/utils
   component_registry.py881583%55–56, 59–60, 65–66, 71, 81–91
   exceptions.py28775%22, 42–63, 106–127
   graph.py56886%35, 46, 59, 61, 63, 74, 79, 81
   registry.py28486%23–26, 41
retrack/validators
   base.py3167%10
   node_exists.py14286%35, 37
TOTAL11567993% 

Tests Skipped Failures Errors Time
65 0 💤 0 ❌ 0 🔥 3.331s ⏱️

Copy link
Collaborator

@caiodallaqua caiodallaqua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@gabrielguarisa gabrielguarisa merged commit 661d2ce into main Mar 11, 2024
3 checks passed
@gabrielguarisa gabrielguarisa deleted the f/replace-unidecode branch March 11, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants