-
Notifications
You must be signed in to change notification settings - Fork 17
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
docs: [FC-0074] use glossary as reference material #221
Changes from 8 commits
be327ea
d8303e6
1712817
4a92546
d11e2c9
c7025e9
ef3a9a0
420cad0
9be58a1
0b70aa8
48b814f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Open edX Filters Glossary | ||
########################## | ||
|
||
A filter has multiple components that are used to define, execute and handle filters, such as pipeline, pipeline steps, filter definition, filter signature, filter type, filter exceptions, filter configuration, etc. This glossary provides definitions for some of the terms to ease the adoption of the Open edX Filters library. | ||
|
||
.. glossary:: | ||
|
||
Pipeline | ||
A pipeline is a list of functions executed in a specific order; these functions are known as pipeline steps. Each function in the pipeline takes the output of the previous function as its input, with the final function's output serving as the overall output of the filter. These pipelines are configured in the filter configuration and are executed in sequence. | ||
|
||
Pipeline Step | ||
A pipeline step is a function within a pipeline that receives, processes, and returns data. Each step may perform operations like transforming, validating, filtering, or enriching data. Pipeline steps are implemented as classes that inherit from a base step class and define specific logic within their ``run_filter`` method, which conforms to the filter's signature. | ||
sarina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Filter Definition | ||
A filter definition is the class that defines the ``run_filter`` method for a filter, specifying the input and output behavior. This class, which inherits from a standard filter base, executes the configured pipeline steps, enabling custom processing within the defined filter. | ||
sarina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Filter Signature | ||
The filter signature consists of the specific parameters required by a filter's ``run_filter`` method. It defines the expected input and output structure for the filter, detailing the data the filter will process. | ||
|
||
Filter Type | ||
The filter type is a unique identifier for the filter, following a standardized format (e.g., reverse DNS style). This type is used as an index for configuring the filter pipeline and specifies which configuration settings apply to a given filter. | ||
sarina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Filter Exceptions | ||
Filters can raise exceptions to control the flow of the pipeline. If a filter raises an exception, the pipeline halts, and the exception becomes the pipeline's output. Exceptions are typically raised when certain conditions specified in the filter's logic are met, signaling an event or state change. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are exceptions a recommended practice, or should they be avoided except in extreme cases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We encourage using exceptions when it makes sense considering the use case of the filter. For example, the course enrollment filter has its own exceptions cause some developers might want to stop the enrollment process when a condition is met. But there are other filters, like changing the IDV URL during runtime, where raising an exception doesn't make much sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good - sounds pretty conditional, don't think another note needs to be made. |
||
|
||
Filter Configuration | ||
Filter configuration is a dictionary that defines the pipeline settings for a filter. Each filter type has its own configuration, which includes settings like whether errors should fail silently or propagate, and the sequence of pipeline steps. Configurations specify the filter type, error-handling preferences, and a list of module paths for each pipeline step to be executed. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ References | |
:maxdepth: 1 | ||
:caption: Contents: | ||
|
||
glossary | ||
filters | ||
django-plugins-and-filters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be explained a little better. But I may not get it right. Maybe,
I think the phrase " which is the set of parameters that the filter receives and returns" isn't needed, because we explain that in detail in the lines above the test.