TypeError: join() argument must be str or bytes, not 'list' code example
Example 1: PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Eav\Model\Attribute\Data\Text::validateLength() must be of the type string, null given
public function validateValue($value)
{
$errors = [];
$attribute = $this->getAttribute();
if ($value === false) {
// try to load original value and validate it
$value = $this->getEntity()->getDataUsingMethod($attribute->getAttributeCode());
}
if (!$attribute->getIsRequired() && empty($value)) {
return true;
}
if (empty($value) && $value !== '0' && $attribute->getDefaultValue() === null) {
$label = __($attribute->getStoreLabel());
$errors[] = __('"%1" is a required value.', $label);
}
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/validatelog.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info($attribute->getName());
$validateLengthResult = $this->validateLength($attribute, $value);
$errors = array_merge($errors, $validateLengthResult);
$validateInputRuleResult = $this->validateInputRule($value);
$errors = array_merge($errors, $validateInputRuleResult);
if (count($errors) == 0) {
return true;
}
return $errors;
}
Example 2: TypeError: strptime() argument 1 must be str, not Series
train['date1'] = train['ID'].apply(lambda x: datetime.strptime(x, '%Y%m%d%H'))