Skip to content

Deduped technologies #35

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

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ Returns a JSON object with the following schema:

The following parameters can be used to filter the data:

- `client` (optional): A string with the client: `mobile` or `desktop`.
- `technology` (optional): A comma-separated string representing the technology name(s) or `ALL`.
- `category` (optional): A comma-separated string representing the category name(s).
- `onlyname` (optional): No value required. If present, only the technology names will be returned.
Expand All @@ -255,7 +254,7 @@ The following parameters can be used to filter the data:

```bash
curl --request GET \
--url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp&client=mobile'
--url 'https://{{HOST}}/v1/technologies?category=Live%20chat%2C%20blog&technology=Smartsupp'
```

Returns a JSON object with the following schema:
Expand All @@ -266,7 +265,10 @@ Returns a JSON object with the following schema:
"client": "mobile",
"similar_technologies": null,
"description": "Smartsupp is a live chat tool that offers visitor recording feature.",
"origins": 25649,
"origins": {
"desktop": 22178,
"mobile": 25649
},
"technology": "Smartsupp",
"category": "Live chat"
}
Expand Down
1 change: 0 additions & 1 deletion functions/technologies/libs/presenters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class Presenters:
@staticmethod
def technology(item):
return {
'client': item['client'],
'similar_technologies': item['similar_technologies'],
'description': item['description'],
'origins': item['origins'],
Expand Down
5 changes: 1 addition & 4 deletions functions/technologies/libs/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ def list_data(params):
filter=FieldFilter("category_obj", "array_contains_any", params_array)
)

if "client" in params:
query = query.where(filter=FieldFilter("client", "==", params["client"]))

documents = query.stream()
data = []

if "onlyname" in params and "client" not in params:
if "onlyname" in params:
appended_tech = set()
for doc in documents:
tech = doc.get("technology")
Expand Down
2 changes: 1 addition & 1 deletion functions/technologies/libs/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def validate(self):
# self.add_error("technology", "missing technology parameter")

return Result(errors=self.errors, result=self.params)

def add_error(self, key, error):
self.errors.append([key, error])

Expand Down