Skip to content
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

"No value associated with key CodingKeys(stringValue: \"sheetData\", intValue: nil) (\"sheetData\")." #15

Closed
maxvol opened this issue Nov 23, 2018 · 3 comments

Comments

@maxvol
Copy link

maxvol commented Nov 23, 2018

(lldb) po file.parseWorksheetPaths()
▿ 3 elements

  • 0 : "xl/worksheets/sheet3.xml"
  • 1 : "xl/worksheets/sheet2.xml"
  • 2 : "xl/worksheets/sheet1.xml"

(lldb) po file.parseWorksheet(at: "xl/worksheets/sheet3.xml")
▿ DecodingError
▿ keyNotFound : 2 elements
- .0 : CodingKeys(stringValue: "sheetData", intValue: nil)
▿ .1 : Context
- codingPath : 0 elements
- debugDescription : "No value associated with key CodingKeys(stringValue: "sheetData", intValue: nil) ("sheetData")."
- underlyingError : nil

@MaxDesiatov
Copy link
Collaborator

Thank you @maxvol, this is a very interesting one, sheetData is a property which stores all of the worksheet rows and cells. I've not been able to recreate even with empty documents though. Could you please share it here or privately to this email for further examination? Any other details, specifically on what software created this worksheet, would be appreciated.

@maxvol
Copy link
Author

maxvol commented Nov 23, 2018

Here it is -
"\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006\" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\"><dimension ref="A1"/><sheetView workbookViewId="0"/><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>"

@MaxDesiatov
Copy link
Collaborator

Thanks @maxvol, I hope that #17 fixes this for you, feel free to reopen this issue otherwise.

MaxDesiatov added a commit that referenced this issue Nov 24, 2018
As previously reported, there are Excel documents in the wild that contain no `sheetData` node. While I was no able to recreate these sheets, I assume these still can be generated by some tools or apps. They do make sense as empty worksheets, so let's allow these in the `Worksheet` model type. To cleanup the naming a new non-optional property `data` has been added. The previous name and type are aliased for source compatibility with a deprecation warning.

Resolves #15.

* Rename sheetData on Worksheet and make it optional
* Fix incorrect deprecation warning for `sheetData`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants