We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef6de76 commit 2420933Copy full SHA for 2420933
pandas/core/internals.py
@@ -717,8 +717,23 @@ def _is_empty_indexer(indexer):
717
block = block.convert(numeric=False)
718
719
return block
720
- except (ValueError, TypeError):
+ except ValueError:
721
raise
722
+ except TypeError:
723
+
724
+ # cast to the passed dtype if possible
725
+ # otherwise raise the original error
726
+ try:
727
+ # e.g. we are uint32 and our value is uint64
728
+ # this is for compat with older numpies
729
+ block = self.make_block(transf(values.astype(value.dtype)))
730
+ return block.setitem(indexer=indexer, value=value, mgr=mgr)
731
732
+ except:
733
+ pass
734
735
+ raise
736
737
except Exception:
738
pass
739
0 commit comments