pombreda / pysal

Automatically exported from code.google.com/p/pysal
Other
0 stars 0 forks source link

Handling None value in pyDbfIO #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I need to copy the values in an existing dbf file into a new dbf file.
For a data column whose type is date, there are some records where the value is 
None.
Since pydbfIO raises error when there is a None value, 
I cannot copy data values into a new dbf easily. 
I guess I can check and remove all None-value records before copying each row.
However, when the table has many columns it involves two many unnecessary 
tasks. 
It would be nice if pydbfIO replaces None with a default acceptable value 
without raising error. 

Original issue reported on code.google.com by mhwa...@gmail.com on 10 Feb 2012 at 10:52

GoogleCodeExporter commented 9 years ago

Original comment by schmi...@gmail.com on 1 May 2012 at 9:20

GoogleCodeExporter commented 9 years ago

Original comment by schmi...@gmail.com on 1 May 2012 at 9:34

GoogleCodeExporter commented 9 years ago
Fixed in revision, 1272.

None values can now be written to any type.  They will be recorded and 
"\0"*size, with the exception of strings which are stores as " "*size.  If you 
write a None to a String field, it will be read back in as an empty string.  I 
think this is the correct behavior.

Original comment by schmi...@gmail.com on 13 Jul 2012 at 5:58