- Issue created by @tannguyenhn
- last update
over 1 year ago 69 pass - last update
over 1 year ago 69 pass - Status changed to Needs work
over 1 year ago 7:28am 5 July 2023 - 🇨🇦Canada jibran Toronto, Canada
@larowlan what do you think about this patch? I know in the current state we can do this by adding validation for this and then skip over the row but I thought having a plugin makes sense.
-
+++ b/src/Plugin/DatasetTransform/Skip.php @@ -0,0 +1,49 @@ + $skip = $this->configuration['not_equals'] ? ($field_value != $field_value_to_compare) : ($field_value == $field_value_to_compare);
Can we have a strict comparison?
-
+++ b/tests/modules/data_pipelines_test/data_pipelines_test.data_pipelines.yml @@ -56,3 +56,26 @@ pipeline_with_no_validation: + - plugin: skip
Let's add a not-equal test as well.
-
+++ b/src/TransformValidDataIterator.php @@ -62,15 +62,15 @@ class TransformValidDataIterator extends \FilterIterator { + if (count($dataset_data) === 0) {
Would there be a case where we want to index and empty row? If yes then we have to update this logic. But I think we'd never want to index empty row.
-
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
+++ b/src/Plugin/DatasetTransform/Skip.php @@ -0,0 +1,49 @@ + return new DatasetData([]); +++ b/src/TransformValidDataIterator.php @@ -62,15 +62,15 @@ class TransformValidDataIterator extends \FilterIterator { + if (count($dataset_data) === 0) {
I think the idea is good, but I think throwing an Exception instead of overloading an empty dataset it more explicit.
🤔 Just when you thought we weren't getting even closer to migrate module
- last update
over 1 year ago 69 pass - last update
over 1 year ago 69 pass - last update
over 1 year ago 69 pass - last update
over 1 year ago 69 pass - Status changed to Needs review
over 1 year ago 3:45am 6 July 2023 - 🇨🇦Canada jibran Toronto, Canada
+++ b/src/TransformValidDataIterator.php @@ -62,15 +63,18 @@ class TransformValidDataIterator extends \FilterIterator { + $this->dataset->addLogMessage(sprintf('Skip in row %d. %s', $this->position, $e->getMessage()), FALSE);
Let's make it more helpful.
- last update
over 1 year ago 69 pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 69 pass - 🇨🇦Canada jibran Toronto, Canada
Thank you for the changes.
+++ b/src/Plugin/DatasetTransform/Skip.php @@ -0,0 +1,54 @@ + $message = $this->configuration['not_equals'] ? sprintf('Value of "%s" is not equal to "%s"', $field_name, $field_value_to_compare)
Let's change this message to the following message.
> The value of the field "%s" is not equal to the value "%". - last update
over 1 year ago 69 pass - last update
over 1 year ago 69 pass - Status changed to RTBC
over 1 year ago 3:25am 7 July 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
+++ b/src/Exception/TransformSkipRecordException.php @@ -0,0 +1,12 @@ + * Class TransformSkipRecordException.
Can we get something useful on this one?
e.g. Provides an exception that is thrown when a row is skipped
Can be fixed on commit
Great work here folks 🎉
- Status changed to Fixed
over 1 year ago 2:59pm 8 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.