Comments (3)
Thanks @SohamRatnaparkhi, I have assigned you.
As stated in the issue, the endpoint is
GET /tasks
. The controller name for that you can find in the OpenAPI specification. I am not looking it up for you, so that you will have a chance to explore how OpenAPI specs are structured ;-)Note that there are two general approaches you could follow here:
1. **Only fetch tasks matching the prefix from the database.** Here you would need to find out how you can define and pass such a filter when doing a database call. Such a solution is preferred as it will be much more performant, especially when we will have thousands of tasks. However, I am not 100% sure it's possible with MongoDB, but https://www.mongodb.com/docs/manual/reference/operator/query/regex/ looks promising. 2. **Filter matching tasks _after_ the database call.** This is the general approach you describe. If you do not get anywhere with approach (1), make sure that you don't just use a plain `for` loop. Instead make use of `map()` or use a list comprehension. In fact, you should probably try both and see which approach is more performant. If you can think of any other solutions, include them in your benchmark.
Yep. This works as well!
I will try to come up with a solution soon and will draft a PR.
from protes.
Hi @uniqueg ,
I would love to solve this issue.
One possible brute force approach to solving it would involve iterating through all the tasks and appending any tasks that begin with a specified string, such as 'foo,' to a list, which would then be returned.
I have reviewed the code base, but I was unable to locate the controller for this request. Based on my analysis, the controller may be in either server.py or task_runs.py. If I am mistaken, please direct me to the correct controller. Otherwise, I am prepared to create a new function to address the issue.
Thank you!
from protes.
Thanks @SohamRatnaparkhi, I have assigned you.
As stated in the issue, the endpoint is GET /tasks
. The controller name for that you can find in the OpenAPI specification. I am not looking it up for you, so that you will have a chance to explore how OpenAPI specs are structured ;-)
Note that there are two general approaches you could follow here:
- Only fetch tasks matching the prefix from the database. Here you would need to find out how you can define and pass such a filter when doing a database call. Such a solution is preferred as it will be much more performant, especially when we will have thousands of tasks. However, I am not 100% sure it's possible with MongoDB, but https://www.mongodb.com/docs/manual/reference/operator/query/regex/ looks promising.
- Filter matching tasks after the database call. This is the general approach you describe. If you do not get anywhere with approach (1), make sure that you don't just use a plain
for
loop. Instead make use ofmap()
or use a list comprehension. In fact, you should probably try both and see which approach is more performant. If you can think of any other solutions, include them in your benchmark.
from protes.
Related Issues (20)
- Store geolocations of TES instances HOT 7
- Middleware called before task is created
- Several issues with TES/input URI processing in distance-based task distribution logic
- Fix docstrings HOT 1
- Fix naming of TES task request objects HOT 2
- Task state set incorrectly when best TES instance fails HOT 4
- Enforce immutability for incoming task document HOT 3
- Error handling issues in calculate_distance function of distance-based task distribution module
- test: unit test for tasks module HOT 1
- ignore Funnel basic credential if task submitted to TESK HOT 2
- Add Access Control
- Tasks with inputs without URLs fail HOT 1
- Report and publish code coverage
- Fetch available TES instances dynamically
- Enable auth and bearer token validation. HOT 2
- Write models for custom config validation
- Next page cursor loop
- build: exclude Connexion >3
- fix: unit tests HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protes.