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

requisitions and applications #8

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from genson import SchemaBuilder
from tap_adp.tap import TapADP
from tap_adp.streams import WorkersStream, PayrollInstructionStream, PayDataInputStream, USTaxProfileStream
from tap_adp.streams import JobRequisitionStream, JobApplicationStream
from dotenv import load_dotenv
from decimal import Decimal

Expand Down Expand Up @@ -67,22 +67,13 @@ def main():
tap = TapADP(config=config)

# Configure this part as-needed for the streams you want to generate schemas for.
parent = WorkersStream(tap=tap)
children = {
"payroll_instruction": PayrollInstructionStream(tap=tap),
"pay_data_input": PayDataInputStream(tap=tap),
"us_tax_profile": USTaxProfileStream(tap=tap),
"job_requisition": JobRequisitionStream(tap=tap),
"job_application": JobApplicationStream(tap=tap),
}


gen = parent.get_records(context=None)
first = next(gen, None)
if not first:
raise RuntimeError("no parent entries found")
context = parent.get_child_context(record=first, context=None)

for child_name, child_stream in children.items():
generate_schema(child_stream, context=context, output_file=f'tap_adp/schemas/{child_name}.json')
generate_schema(child_stream, context=None, output_file=f'tap_adp/schemas/{child_name}.json')

if __name__ == '__main__':
main()
Loading
Loading